Skip to content
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

Sync versions: use stable version instead of querying all versions #7380

Merged
merged 2 commits into from
Nov 30, 2020

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Aug 12, 2020

We are iterating over all versions just to get the current stable
version, but we already have this information in the "stable" version.

Tests needed to update the default version since
some versions were created manually instead of calling the API as they
normally do (we already have this for some tests).

We are iterating over all versions just to get the current stable
version, but we already have this information in the "stable" version.

Tests needed to update the default version since
some versions were created manually instead of calling the API as they
normally do (we already have this for some tests).
@stsewd
Copy link
Member Author

stsewd commented Aug 12, 2020

Need to test this more locally.

@stsewd
Copy link
Member Author

stsewd commented Aug 12, 2020

Local testing is looking good.

@stsewd stsewd requested a review from a team August 12, 2020 17:06
old_highest_version = determine_stable_version(project.versions.all())
if old_highest_version is not None:
activate_new_stable = old_highest_version.active
current_stable = project.get_original_stable_version()
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this checking for a new stable version (eg. the user has pushed a new higher version number), not getting it?

Copy link
Member Author

Choose a reason for hiding this comment

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

That is done in the code below

# TODO: move this to an automation rule
promoted_version = project.update_stable_version()
new_stable = project.get_stable_version()
if promoted_version and new_stable and new_stable.active:
log.info(
'Triggering new stable build: %(project)s:%(version)s',
{
'project': project.slug,
'version': new_stable.identifier,
}
)
trigger_build(project=project, version=new_stable)
# Marking the tag that is considered the new stable version as
# active and building it if it was just added.
if (
activate_new_stable and
promoted_version.slug in added_versions
):

We just use this to get activate_new_stable

@stale
Copy link

stale bot commented Oct 10, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Oct 10, 2020
@stsewd stsewd removed the Status: stale Issue will be considered inactive soon label Oct 12, 2020
@stale
Copy link

stale bot commented Nov 26, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Nov 26, 2020
@stsewd stsewd removed the Status: stale Issue will be considered inactive soon label Nov 30, 2020
@stsewd stsewd requested a review from a team November 30, 2020 17:28
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

This makes sense to me 👍

@stsewd stsewd merged commit 02a81dd into master Nov 30, 2020
@stsewd stsewd deleted the sync-versions-opt branch November 30, 2020 21:17
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