feat: allow inheritance of devcontainer.metadata in the re-usable workflows#1357
feat: allow inheritance of devcontainer.metadata in the re-usable workflows#1357Ron (rjaegers) wants to merge 3 commits into
devcontainer.metadata in the re-usable workflows#1357Conversation
|
devcontainer.metadata in the re-usable workflows
📦 Container Size AnalysisNote Comparing 📈 Size Comparison Table
|
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|
| ✅ ACTION | actionlint | 23 | 0 | 0 | 0.92s | |
| ✅ DOCKERFILE | hadolint | 4 | 0 | 0 | 0.28s | |
| ✅ JSON | npm-package-json-lint | yes | no | no | 2.34s | |
| ✅ JSON | prettier | 38 | 2 | 0 | 0 | 0.73s |
| ✅ JSON | v8r | 38 | 0 | 0 | 18.75s | |
| markdownlint | 13 | 0 | 1 | 0 | 1.36s | |
| ✅ MARKDOWN | markdown-table-formatter | 13 | 0 | 0 | 0 | 0.4s |
| ✅ REPOSITORY | checkov | yes | no | no | 27.56s | |
| ✅ REPOSITORY | gitleaks | yes | no | no | 1.56s | |
| ✅ REPOSITORY | git_diff | yes | no | no | 0.02s | |
| ✅ REPOSITORY | grype | yes | no | no | 56.75s | |
| osv-scanner | yes | 1 | no | 0.94s | ||
| ✅ REPOSITORY | secretlint | yes | no | no | 2.35s | |
| ✅ REPOSITORY | syft | yes | no | no | 2.47s | |
| ✅ REPOSITORY | trivy | yes | no | no | 12.82s | |
| ✅ REPOSITORY | trivy-sbom | yes | no | no | 0.66s | |
| ✅ REPOSITORY | trufflehog | yes | no | no | 3.72s | |
| lychee | 106 | 1 | 0 | 11.29s | ||
| ✅ YAML | prettier | 32 | 0 | 0 | 0 | 1.31s |
| ✅ YAML | v8r | 32 | 0 | 0 | 14.49s | |
| ✅ YAML | yamllint | 32 | 0 | 0 | 1.35s |
Detailed Issues
⚠️ SPELL / lychee - 1 error
📝 Summary
---------------------
🔍 Total..........148
🔗 Unique.........123
✅ Successful.....142
⏳ Timeouts.........0
🔀 Redirected......18
👻 Excluded.........0
❓ Unknown..........0
🚫 Errors...........1
⛔ Unsupported......1
Errors in .github/TOOL_VERSION_ISSUE_TEMPLATE.md
[403] https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads (at 38:7) | Rejected status code: 403 Forbidden
Hint: Followed 18 redirects. You might want to consider replacing redirecting URLs with the resolved URLs. Use verbose mode (`-v`/`-vv`) to see redirection details.
Hint: You can configure accepted/rejected response codes with `-a` or `--accept`
⚠️ MARKDOWN / markdownlint - 1 error
docs/adr/0000-record-architecture-decisions.md:30:401 error MD013/line-length Line length [Expected: 400; Actual: 520]
⚠️ REPOSITORY / osv-scanner - 1 error
Scanning dir .
Starting filesystem walk for root: /
Scanned .devcontainer/docs/requirements.txt file and found 14 packages
Scanned .devcontainer/cpp/requirements.txt file and found 20 packages
Scanned package-lock.json file and found 73 packages
Scanned test/rust/workspace/cargo/Cargo.lock file and found 1 package
Scanned test/rust/workspace/test/Cargo.lock file and found 1 package
Scanned test/rust/workspace/cortex-m/Cargo.lock file and found 20 packages
Scanned test/rust/workspace/clippy/Cargo.lock file and found 1 package
Scanned test/rust/workspace/cortex-mf/Cargo.lock file and found 20 packages
End status: 104 dirs visited, 339 inodes visited, 8 Extract calls, 31.117995ms elapsed, 31.118207ms wall time
Total 2 packages affected by 2 known vulnerabilities (0 Critical, 0 High, 0 Medium, 0 Low, 2 Unknown) from 1 ecosystem.
0 vulnerabilities can be fixed.
+-----------------------------------+------+-----------+------------+---------+---------------+------------------------------------------+
| OSV URL | CVSS | ECOSYSTEM | PACKAGE | VERSION | FIXED VERSION | SOURCE |
+-----------------------------------+------+-----------+------------+---------+---------------+------------------------------------------+
| https://osv.dev/RUSTSEC-2026-0110 | | crates.io | bare-metal | 0.2.5 | -- | test/rust/workspace/cortex-m/Cargo.lock |
| https://osv.dev/RUSTSEC-2026-0110 | | crates.io | bare-metal | 0.2.5 | -- | test/rust/workspace/cortex-mf/Cargo.lock |
+-----------------------------------+------+-----------+------------+---------+---------------+------------------------------------------+
Notices
📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)
See detailed reports in MegaLinter artifacts
You could have the same capabilities but better runtime performances if you use a MegaLinter flavor:
- oxsecurity/megalinter/flavors/salesforce@v9.5.0 (59 linters)
- oxsecurity/megalinter/flavors/javascript@v9.5.0 (62 linters)
Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)
- Documentation: Custom Flavors
- Command:
npx mega-linter-runner@9.5.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,DOCKERFILE_HADOLINT,JSON_V8R,JSON_PRETTIER,JSON_NPM_PACKAGE_JSON_LINT,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_GITLEAKS,REPOSITORY_GRYPE,REPOSITORY_OSV_SCANNER,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,SPELL_LYCHEE,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

Show us your support by starring ⭐ the repository
There was a problem hiding this comment.
Pull request overview
This PR reduces duplication in devcontainer metadata across image flavors by introducing a metadata-merge script and wiring it into the build/push workflows, while also updating per-flavor metadata payloads and expanding base image integration tests.
Changes:
- Add a script to merge
devcontainer.metadataarrays (base + flavor) and verify the resulting label on pushed images. - Refactor per-flavor
devcontainer-metadata.jsonto remove base-duplicated entries and centralize base defaults. - Expand base integration tests to validate pinned apt package versions, tool inventory presence, locale defaults, and bash-completion.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
test/base/integration-tests.bats |
Adds additional base-image verification tests (apt pins, tool inventory, locale, bash completion). |
README.md |
Documents the metadata-array inheritance/merge approach for flavors and derived images. |
.github/workflows/wc-build-push.yml |
Generates merged devcontainer.metadata label and verifies it on the pushed image. |
.github/workflows/wc-build-push-test.yml |
Plumbs base-image reference input through to the lower-level build workflow. |
.github/workflows/update-dependencies.yml |
Includes base flavor in the dependency update matrix. |
.github/workflows/build-push-test.yml |
Passes base image reference so flavor builds can merge inherited metadata. |
.github/scripts/merge-devcontainer-metadata.sh |
New helper to concatenate base + flavor devcontainer.metadata arrays per spec behavior. |
.devcontainer/base/devcontainer-metadata.json |
New base metadata entry to be inherited by flavors via array merging. |
.devcontainer/cpp/Dockerfile |
Creates a default compile_commands.json location for tooling compatibility. |
.devcontainer/cpp/devcontainer-metadata.json |
Updates C++ flavor extensions/settings to rely on inherited base metadata. |
.devcontainer/embedded-cpp/devcontainer-metadata.json |
Updates embedded C++ flavor extensions/settings to rely on inherited base metadata. |
.devcontainer/docs/devcontainer-metadata.json |
Streamlines docs flavor extension list. |
.devcontainer/rust/devcontainer-metadata.json |
Streamlines rust flavor extension list. |
| "[c][cpp]": { | ||
| "editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd" | ||
| } |
| "[c][cpp]": { | ||
| "editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd" | ||
| } |
| INSTALLED_VERSION=$(dpkg-query -W -f='${Version}' "${PACKAGE}") | ||
| assert_equal "${INSTALLED_VERSION}" "${EXPECTED_VERSION}" |
| # The sed expression is a workaround for quotes being eaten in arrays when passed | ||
| # through `docker buildx build --label` (e.g. ["x", "y"] -> ["x",y]). |
📦 Container Size AnalysisNote Comparing 📈 Size Comparison Table
|
📦 Container Size AnalysisNote Comparing 📈 Size Comparison Table
|
📦 Container Size AnalysisNote Comparing 📈 Size Comparison Table
|
📦 Container Size AnalysisNote Comparing 📈 Size Comparison Table
|



🚀 Hey, I have created a Pull Request
Description of changes
This pull request introduces significant improvements to how devcontainer metadata is managed and merged across image flavors, enhances the CI/CD workflows for building and testing images, and adds new integration tests for base image validation. The most important changes include implementing a script and workflow logic to merge
devcontainer.metadatalabels according to the Dev Container spec, updating metadata and extension lists for devcontainer flavors, and expanding test coverage for base image contents.Devcontainer metadata management and merging:
.github/scripts/merge-devcontainer-metadata.shto merge the base image'sdevcontainer.metadataarray with the current flavor's metadata, ensuring proper inheritance and avoiding duplication as per the Dev Container specification..github/workflows/wc-build-push.yml,.github/workflows/build-push-test.yml,.github/workflows/wc-build-push-test.yml) to use the new merge script, pass base image references, and verify the merged metadata label on built images. [1] [2] [3] [4] [5] [6]Devcontainer flavor metadata and extension updates:
.devcontainer/base/devcontainer-metadata.jsonand updated all flavor-specificdevcontainer-metadata.jsonfiles to streamline extension lists, remove redundant entries, and unify formatter settings. [1] [2] [3] [4] [5] [6]README.mdto document the new metadata merging approach and its rationale.Base image and flavor build/test improvements:
compile_commands.jsonto/root/.ampin the C++ Dockerfile to improve compatibility with tools like SonarLint and Clangd.baseflavor in the update-dependencies workflow matrix for comprehensive dependency management.Test coverage enhancements:
test/base/integration-tests.batsto verify that all apt packages are installed at their pinned versions, tools from the inventory are present, theC.UTF-8locale is set, and bash-completion is enabled for root.These changes collectively improve maintainability, correctness, and developer experience when working with devcontainer images and their metadata.
✔️ Checklist