Conversation
Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
neilime
left a comment
There was a problem hiding this comment.
@copilot package versions assertions must be more accurate and precise:
- monoarch - unsigned: 1 tagged version (0.1.0), and 1 untagged (dedicated arch platform)
- monoarch - signed: 2 tagged version (0.1.0 and the sigstore sha256-...) and 2 unttaged versions (dedicated arch platform and the sigdstore dsse-envelope)
- multioarch - unsigned: 1 tagged version (0.1.0), and 2 untagged (dedicated arch platforms)
- multiarch - signed: 2 tagged version (0.1.0 and the sigstore sha256-...) and 3 unttaged versions (2 dedicated arch platforms and the sigdstore dsse-envelope)
…mono/multi-arch Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
Updated the package version assertions to be more precise and accurate. The workflow now correctly validates:
Each assertion now separately validates total count, tagged count, and untagged count with clear error messages. Fixed in commit d459c8c. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
Factorized the workflow by combining signed and unsigned build jobs into a single Image names are now dynamic using a unique prefix per run: The cleanup job automatically uses the same dynamic prefix to remove ephemeral packages. Fixed in commit eba9044. |
Matrix configuration is now prepared in the This provides a single source of truth for the matrix definition, eliminating duplication and making it easier to maintain. Any changes to test scenarios only need to be made in one place. Fixed in commit 70f1fcc. |
3b5cdb3 to
40f5f7e
Compare
ae1236a to
c8775a9
Compare
Co-authored-by: neilime <314088+neilime@users.noreply.github.com> Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
c8775a9 to
6d40e9c
Compare
Overview
This PR enhances the
__test-workflow-docker-build-images.ymltest workflow to comprehensively verify package version creation and test all combinations of image architectures (mono-arch/multi-arch) and signing states (signed/unsigned). The implementation follows the pattern from the test-docker-build-images repository.Problem
The previous workflow had limited test coverage and didn't verify the number of package versions created during the build process. It tested only signed images and didn't distinguish between mono-arch and multi-arch testing scenarios, making it difficult to catch regressions in specific build configurations. Additionally, the workflow used static image names that prevented parallel execution across multiple PRs and branches, and had duplicated matrix configurations across multiple jobs.
Solution
1. Dynamic Image Names for Parallel Runs
Implemented unique image name generation to support parallel workflow execution:
arrangejobtest-pr-{PR#}-{run_number}for pull requeststest-{branch}-{run_number}for branch pushes2. Centralized Matrix Configuration
Matrix configuration is now prepared once in the
arrangejob and reused across all dependent jobs:actions/github-scriptin the arrange jobact-build-imagesandassert-imagesjobs consume the matrix viafromJson(needs.arrange.outputs.matrix)3. Unified Matrix-Based Build Job
Consolidated separate signed/unsigned build jobs into a single factorized job:
act-build-images- Unified job using centralized matrix withsignparameter:This reduces code duplication significantly while maintaining full test coverage.
4. Package Version Assertions (New Feature)
Added comprehensive assertion jobs that verify the exact number of package versions created, accounting for sigstore signing artifacts:
assert-images- Unified assertion job for all image variants:The assertions validate separate counts for tagged and untagged versions, accounting for:
Test Coverage
The workflow now tests 4 distinct scenarios with precise version count validation:
{prefix}-mono-arch-unsigned{prefix}-mono-arch-signed{prefix}-multi-arch-unsigned{prefix}-multi-arch-signedEach scenario comprehensively validates:
Technical Notes
Matrix Strategy vs YAML Anchors
While the issue mentioned using YAML anchors for factorization, GitHub Actions' actionlint validator doesn't support anchors in certain contexts (particularly
runfields and step aliases). The implementation uses matrix strategy instead, which:Backward Compatibility
The existing
act-build-args-secrets-and-registry-cachingjob and its assertions remain unchanged, ensuring backward compatibility with other tests that depend on this workflow.Benefits
Testing
Related
Inspired by: https://github.com/hoverkraft-tech/test-docker-build-images/blob/main/.github/workflows/main-ci.yml
Fixes the requirement to assert package version counts and test all combinations of mono-arch/multi-arch and signed/unsigned images.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.