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

ADNCD-1948: Add workaround for all PRs being rebuilt after GitHub migration #8

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

sandro-h
Copy link

On initial load of a PR material (handleGetLatestRevision), store all seen PRs, not just the one we're building. For subsequent loads (handleLatestRevisionSince) behave the same as before, and only store the PR we're building.

Also tried fancier variants where you can configure the behavior per PR material, even allowing to clear the state and rebuild everything. However, there seems to be a GoCD caching bug such that PR material config changes in the UI are properly displayed, but not actually propagated to the PR plugin. It keeps using the old config until GoCD is restarted, or the PR material (and due to dependency the referencing config repo) is removed and readded.

…ration

On initial load of a PR material (handleGetLatestRevision), store all
seen PRs, not just the one we're building. For subsequent loads
(handleLatestRevisionSince) behave the same as before, and only store
the PR we're building.

Also tried fancier variants where you can configure the behavior per PR
material, even allowing to clear the state and rebuild everything.
However, there seems to be a GoCD caching bug such that PR material
config changes in the UI are properly displayed, but not actually
propagated to the PR plugin. It keeps using the old config until
GoCD is restarted, or the PR material (and due to dependency the
referencing config repo) is removed and readded.
@sandro-h sandro-h requested a review from dodie August 19, 2024 16:24
@@ -227,7 +228,12 @@ GoPluginApiResponse handleGetLatestRevision(GoPluginApiRequest goPluginApiReques
}

// Remove all other branches from the response to ensure the next time those will be picked up by GoCD
branchToRevisionMap.entrySet().removeIf(entry -> !Objects.equals(entry.getKey(), newerRevision.getKey()));
if (provider instanceof GitHubProvider) {
Copy link

Choose a reason for hiding this comment

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

Looks good!

This is not related to GitHub generally, but to the migration, is that right?
Is it planned to be merged to master, or will it be hosted on a dedicated branch and get a special version like it's on the pom now?

Copy link
Author

Choose a reason for hiding this comment

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

I was unsure about it, but if it's not too much of a hassle to release from a separate branch, I will do it like that 👍

@sandro-h sandro-h changed the base branch from master to ADNCD-1948_migration_base August 22, 2024 12:41
@sandro-h sandro-h merged commit e6cd268 into ADNCD-1948_migration_base Aug 22, 2024
2 checks passed
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