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

ci: consolidate stage outputs and build rev/arch table #224

Merged
merged 2 commits into from
Nov 27, 2023
Merged

ci: consolidate stage outputs and build rev/arch table #224

merged 2 commits into from
Nov 27, 2023

Conversation

jnsgruk
Copy link
Member

@jnsgruk jnsgruk commented Nov 27, 2023

This change makes some changes to how we track the revisions that have been uploaded from stage to stage.

We cannot easily have multiple matrix outputs, which appears to be a known and common issue. This solution relies instead upon simply querying the store for the latest revision of a given architecture in the candidate channel, and using that.

The template has been adjusted to take a single "table" variable, which is a dynamically built HTML table that has a row for each supported architecture -- markdown tables cannot be used here because of how the template engine (mustache) renders '\n'.

There is a very small chance of a race condition if two PRs are merged in quick succession that we could get incorrect rev numbers, but I think that's mitigated by the concurrency controls which mean that only once instance can run at a given time.

This commit includes some drivebys to tidy up existing names and make things easier to reason about.

This change makes some changes to how we track the revisions that
have been uploaded from stage to stage.

We cannot easily have multiple matrix outputs, which appears to
be a known and common issue. This solution relies instead upon
simply querying the store for the latest revision of a given
architecture in the candidate channel, and using that.

The template has been adjusted to take a single "table" variable,
which is a dynamically built HTML table that has a row for each
supported architecture -- markdown tables cannot be used here
because of how the template engine (mustache) renders '\n'.

There is a very small chance of a race condition if two PRs are
merged in quick succession that we could get incorrect rev numbers,
but I think that's mitigated by the concurrency controls which mean
that only once instance can run at a given time.

This commit includes some drivebys to tidy up existing names and
make things easier to reason about.
@jnsgruk
Copy link
Member Author

jnsgruk commented Nov 27, 2023

Oh and this is an example of the template rendering properly on my own branch (albeit with artificial rev numbers cos permissions...): https://github.com/jnsgruk/signal-desktop/issues/17

@merlijn-sebrechts
Copy link
Member

Did you add the concurrency settings? https://docs.github.com/en/actions/using-jobs/using-concurrency

By default, it will run multiple in parallel. I'm not sure if we should queue new invocations or cancel previous ones, though. Feel free to make a decision on that as you see fit.

@jnsgruk
Copy link
Member Author

jnsgruk commented Nov 27, 2023

Ah, I thought that was already present! I've added it now :)

Copy link
Member

@merlijn-sebrechts merlijn-sebrechts left a comment

Choose a reason for hiding this comment

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

Although passing the revisions to the next steps/jobs would be better from a "reproducible/traceable builds" standpoint, I agree this method is more than good enough for us at this moment.

Thanks! Let's test this!

@merlijn-sebrechts merlijn-sebrechts merged commit 35a0bf6 into snapcrafters:candidate Nov 27, 2023
1 check passed
@jnsgruk jnsgruk deleted the dynamic-rev-table branch November 27, 2023 17:51
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