Skip to content

Add a Parking Lot (Drafts) #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

jchampio
Copy link

@jchampio jchampio commented Mar 10, 2025

[update 5/25: the name of the feature has been changed to Drafts]

Drafts is a special always-open commitfest for the purpose of holding and testing draft patch submissions. Having such a holding area should make it easier for people to keep track of patchsets they're not quite ready to submit for review. This is one possible implementation of #17.

Internally, Drafts is assigned a static ID of zero. This is chosen because a) it does not overlap with Django's default AutoField sequence, which begins at one, and b) it requires no updates to the current URL patterns, which match nonnegative integers.

The Drafts entry has the special status STATUS_DRAFT so that it does not conflict with pre-existing coded assumptions on what "open", "future", etc. mean. STATUS_DRAFT CFs are excluded from the num_cfs count for a patch.

The new /close/draft handler is added to swap patches into Drafts. Patches are then removed by moving them to the next open CF, or by closing as usual.

Prior to this patch:

  • CFs with IDs less than the current in-progress CF could safely be assumed closed,
  • patches only ever moved forward through increasing CF IDs, and
  • the latest CF start date determined a patch's "current" CF.

These assumptions all break under the current model. They have been modified:

  • use STATUS_CLOSED specifically when deciding whether a CF is closed
  • when moving a patch between CFs, allow for the possibility of an existing entry in the junction table
  • a patch's "current" CF is determined by its latest entry date

Roadmap

  • 0001 and 0002 contain prefactoring patches to reduce the amount of work done in the final commit.
  • 0003 contains migrations for the new statuses.
  • 0004 adds Drafts and related logic.
  • 0005 adds an Open selector to the filter bar UI.
  • 0006 makes Drafts use the Open selector by default.

TODO

  • ensure all prior assumptions on CF ID are cleaned up
  • should the default filter be changed for the Parking Lot?
  • figure out how we will clean out old closed items

"""SELECT ps.status, ps.statusstring, count(*)
FROM commitfest_patchoncommitfest poc
INNER JOIN commitfest_patchstatus ps ON ps.status=poc.status
INNER JOIN commitfest_commitfest cf ON cf.id=poc.commitfest_id
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm probably missing something obvious, but why was this join added? The cf doesn't actually seem to be used.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used in patchlist() here, during personalization. (I'm not a huge fan of the long-distance coupling, but...)

ON CONFLICT (status) DO UPDATE SET statusstring=excluded.statusstring, sortkey=excluded.sortkey;
"""),
migrations.RunSQL(
"DELETE FROM commitfest_patchstatus WHERE status < 1 OR status > 9"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems incorrect? I.e. it won't remove anything afaict.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I meant to add an explanation to the commit but didn't. This is fully cargo-culted from the last change made to commitfest_patchstatus: 535af6e

If this table doesn't need that much pruning in practice, that's fine and I can remove it. But I can't take a look at the current state of the prod database to really know for sure 😁

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Maybe @mhagander knows why this should or should not be done this time around?)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JelteF Is it possible to take a look at prod just to confirm that this code is unnecessary? I'm happy to remove it.

jchampio added 6 commits May 2, 2025 14:25
Simplify the Activity query now that patch links no longer need a
commitfest ID.
The upcoming Drafts commitfest will break the assumption that lower
commitfest IDs are always "in the past".
...for the upcoming Drafts feature.
Drafts is a special always-open commitfest for the purpose of holding
and testing draft patch submissions. Having such a holding area should
make it easier for people to keep track of patchsets they're not quite
ready to submit for review.

Internally, Drafts is assigned a static ID of zero. This is chosen
because a) it does not overlap with Django's default AutoField sequence,
which begins at one, and b) it requires no updates to the current URL
patterns, which match nonnegative integers.

The Drafts entry has the special status STATUS_DRAFT so that it does not
conflict with pre-existing coded assumptions on what "open", "future",
etc. mean. STATUS_DRAFT CFs are excluded from the "num_cfs" count for a
patch.

The new /close/draft handler is added to swap patches into Drafts.
Patches are then removed by moving them to the next open CF, or by
closing as usual.

Prior to this patch:
- CFs with IDs less than the current in-progress CF could safely be
  assumed closed,
- patches only ever moved forward through increasing CF IDs, and
- the latest CF start date determined a patch's "current" CF.

These assumptions all break under the current model. They have been
modified:
- use STATUS_CLOSED specifically when deciding whether a CF is closed
- when moving a patch between CFs, allow for the possibility of an
  existing entry in the junction table
- a patch's "current" CF is determined by its latest entry date

TODO:
- ensure all prior assumptions on CF ID are cleaned up
The Drafts CF can theoretically accumulate a large number of closed
items. Add a filter that encompasses all open statuses so that Drafts
will be able to use it as a default.
This hides abandoned draft patches unless the user specifically asks to
see them.

TODO: Does the behavior of the "Clear" button on the filter UI element
need to change, or does it actually work the way a user would want for
Drafts?
@jchampio jchampio changed the title Add a Parking Lot Add a Parking Lot (Drafts) May 25, 2025
@jchampio
Copy link
Author

The most recent force-push changes the name to Drafts and adds a default "Open" filter to the special CF, to try to keep it from being overwhelmed by abandoned entries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants