-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
External versions: save state (open / closed) #9128
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
Conversation
a7f10ff
to
5c65f16
Compare
When an external Version is created, we mark it as `.state="open"` and when it's closed/merged we mark is as `.state="closed"`. Note that we cannot use `.active=False` for this as we were doing, because we want to keep serving closed/merged PRs during some extra time after they are closed/merged and El Proxito is not serving inactive versions. With this approach, external versions will be always `.active=True` but with different `.state=`. That state is used by the periodic Celery task to know if the version has to be deleted or not. Closes #9109
5c65f16
to
8bff524
Compare
|
||
Return a JSON response with the following:: | ||
|
||
{ | ||
"version_deactivated": true, | ||
"closed": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is changing the API response. Do we have any concerns about this? In theory, nobody should be listen to this response, tho. We reply this to GitHub / GitLab.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, should be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a data migration to change the state of the current inactive external versions to be closed
and to mark them as active.
Migrate inactive versions to `active` and `state=closed`.
Co-authored-by: Santos Gallegos <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a good approach. 👍 for getting it out next week -- I keep hitting old PR builds that don't work..
|
||
Return a JSON response with the following:: | ||
|
||
{ | ||
"version_deactivated": true, | ||
"closed": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, should be fine.
@@ -51,6 +51,12 @@ | |||
(EXTERNAL, EXTERNAL_TEXT), | |||
(UNKNOWN, UNKNOWN_TEXT), | |||
) | |||
EXTERNAL_VERSION_STATE_OPEN = "open" | |||
EXTERNAL_VERSION_STATE_CLOSED = "closed" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want more granularity here? Merged
vs Closed
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the first commit, I used open
, closed
and merged
, but I didn't find how/where we would use it differently, so I removed it because it just complicate the logic. Do you have a good usage for this in mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly displaying the information in the build page, or docs pages. Not a huge deal though, seems fine to start with this.
When an external Version is created, we mark it as
.state="open"
and when it'sclosed/merged we mark is as
.state="closed"
.Note that we cannot use
.active=False
for this as we were doing, because wewant to keep serving closed/merged PRs during some extra time after they are
closed/merged and El Proxito is not serving inactive versions.
With this approach, external versions will be always
.active=True
but withdifferent
.state=
. That state is used by the periodic Celery task to know ifthe version has to be deleted or not.
Closes #9109