Skip to content

Fix devcontainer publish failures on arm64 and harden regression contract checks#239

Merged
wallstop merged 5 commits into
mainfrom
copilot/fix-cicd-build-push-devcontainer
Apr 2, 2026
Merged

Fix devcontainer publish failures on arm64 and harden regression contract checks#239
wallstop merged 5 commits into
mainfrom
copilot/fix-cicd-build-push-devcontainer

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 2, 2026

Description

The Build and Publish Devcontainer workflow was failing on main because powershell was no longer resolvable from apt during multi-arch image builds (arm64). This PR removes that apt dependency, adds regression guards, and hardens those guards based on review feedback to avoid fragile matching behavior.

  • PowerShell install path hardened (Dockerfile)

    • Replaced apt-based powershell install with architecture-aware GitHub release tarball install.
    • Mapped Docker TARGETARCH to PowerShell asset arch (amd64 -> x64, arm64 -> arm64).
    • Verified download integrity with pinned SHA256 before extraction.
    • Kept install location compatible with existing profile usage (/opt/microsoft/powershell/7) and symlinked pwsh/powershell.
  • Regression prevention for devcontainer URL/parser drift

    • Added scripts/tests/test-validate-devcontainer-urls.sh to enforce:
      • PowerShell version + URL template presence in Dockerfile
      • arch mapping contract
      • checksum verification presence
      • validator output includes powershell
  • Review-feedback hardening for test robustness

    • Updated scripts/tests/test-validate-devcontainer-urls.sh to use fixed-string matching (grep -Fq --) for Dockerfile literal contract checks, including ${...} tokens.
    • Added a shared literal assertion helper to reduce duplication and improve diagnostics.
    • Improved failure diagnostics by printing expected literal content and validator output when relevant.
  • Validation pipeline wiring

    • Added test:validate-devcontainer-urls script in package.json.
    • Included it in validate:prepush.
    • Ran it in .github/workflows/validate-devcontainer.yml.
    • Updated workflow path filters so edits to the new test trigger validation.
  • Follow-up CI fix from PR feedback

    • Investigated failing Unity Meta File Lint run (UNH005) and classified it as a configuration/repo-hygiene issue.
    • Added missing companion Unity meta file for the new test script:
      • scripts/tests/test-validate-devcontainer-urls.sh.meta

Related Issue

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactor (code change that neither fixes a bug nor adds a feature)

Checklist

  • I have added tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have updated the CHANGELOG
  • My changes do not introduce breaking changes, or breaking changes are documented

Copilot AI linked an issue Apr 2, 2026 that may be closed by this pull request
9 tasks
Copilot AI changed the title [WIP] Fix CI/CD build and push for devcontainer in main Fix devcontainer publish failures on arm64 by replacing apt PowerShell install with verified release tarballs Apr 2, 2026
Copilot AI requested a review from wallstop April 2, 2026 12:45
@wallstop wallstop requested a review from Copilot April 2, 2026 12:51
@wallstop wallstop marked this pull request as ready for review April 2, 2026 12:51
@wallstop
Copy link
Copy Markdown
Owner

wallstop commented Apr 2, 2026

@copilot Can you investigate the following CI/CD failures and determine if they represent production, configuration, or test bugs? Please provide the appropriate fix (if it is a production issue, fix production, if it is a test issue, fix test, if it is a configuration issue, fix the configuration), etc. Please consider this and similar edge case and error scenarios - if it is possible to add automation that would help catch this and other, similar problems, please do so. If these are test failures, consider converting these or other tests into data-driven tests. Please add additional diagnostics to help understand the issue(s). Consider simplifying if there are too many overlapping concerns, too much complexity, or too much fragility. When changing files, make sure we abide by repo guidelines and rules. If there is any new knowledge learned, be sure to update llm info appropriately.

The goal is to understand why the issues are happening, understand the root caus(es), apply relevant fixes, and create infrastructure such that the entire category of issues can not be made again. I'm only interested in general, complete fixes - this work should be generalized as much as possible. I want to avoid fragility and make these checks extremey robust and reliable.

Feel free to do web searches to understand modern techniques, approaches, and best practices to this and any similar issues.

Please use sub-agents to accomplish these goals. Once a sub-agent is done, have another sub-agent review its work in an adversarial fashion. If there are any recommendations, have another sub-agent consider them and implement them. Repeat this process in a loop until all sub-agents achieve consensus that the result is incredibly high quality (110/100, exceptional work, absolutely zero issues, minor or otherwise) and does not require any revisions. I want 110% here, give it all you've got!

https://github.com/wallstop/unity-helpers/actions/runs/23900885598/job/69698262506?pr=239

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes multi-arch devcontainer build/publish failures (arm64) by removing the apt-based PowerShell install and replacing it with an architecture-aware GitHub release tarball install, plus adds regression tests to prevent future Dockerfile URL/parser drift.

Changes:

  • Replace apt-installed PowerShell with a TARGETARCH-mapped GitHub release tarball install and SHA256 verification in the devcontainer Dockerfile.
  • Add a bash test (test-validate-devcontainer-urls.sh) to enforce validator/Dockerfile parsing contracts (PowerShell version/URL template/arch mapping/checksum + validator output).
  • Wire the new test into npm scripts and the devcontainer validation GitHub Actions workflow.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
.devcontainer/Dockerfile Installs PowerShell from verified GitHub release tarballs with arch mapping and checksum verification to support arm64 builds.
scripts/tests/test-validate-devcontainer-urls.sh Adds regression tests to ensure the URL validator continues to detect PowerShell and related Dockerfile contracts.
package.json Adds test:validate-devcontainer-urls and runs it in validate:prepush.
.github/workflows/validate-devcontainer.yml Runs the new contract test in CI and updates path filters to trigger on changes.

Comment thread scripts/tests/test-validate-devcontainer-urls.sh Outdated
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 2, 2026

@copilot Can you investigate the following CI/CD failures and determine if they represent production, configuration, or test bugs? Please provide the appropriate fix (if it is a production issue, fix ...

Investigated run 23900885598/job 69698262506 and classified it as a configuration/repo-hygiene issue (not production logic): CI failed because scripts/tests/test-validate-devcontainer-urls.sh was added without its required Unity companion .meta file. I fixed this by adding scripts/tests/test-validate-devcontainer-urls.sh.meta in commit a341e2a and validated with bash scripts/tests/test-lint-meta-exclusions.sh plus pwsh -NoProfile -File scripts/lint-meta-files.ps1 -VerboseOutput (both passing).

Copilot AI changed the title Fix devcontainer publish failures on arm64 by replacing apt PowerShell install with verified release tarballs Fix devcontainer publish failures on arm64 and add missing Unity meta for new regression test Apr 2, 2026
@wallstop
Copy link
Copy Markdown
Owner

wallstop commented Apr 2, 2026

@copilot apply changes based on the comments in this thread

Can you parse through the feedback, determine if any of it is relevant, and if it is, provide a comprehensive implementation to address the identified issues and any similar issues? Consider automation, such as tests or githooks to help prevent this category of issue. Please add additional diagnostics to help understand the issue(s). Consider simplifying if there are too many overlapping concerns, too much complexity, or too much fragility. When changing files, make sure we abide by repo guidelines and rules. If there is any new knowledge learned, be sure to update llm info appropriately.

The goal is to understand why the issues are happening, understand the root caus(es), apply relevant fixes, and create infrastructure such that the entire category of issues can not be made again. I'm only interested in general, complete fixes. I want to avoid fragility and make these checks extremey robust and reliable.

If the feedback is relevant, when addressing it, consider the code base as a whole. Are there other files or code areas that this could apply to? If so, do a sweep of those to see if they exhibit similar issues, and if they do, apply similar, appropriate fixes. The idea is to prevent the entire concept and class of issue from happening in the future.

The goal is to understand why feedback is being given, understand the root cause of the feedback, apply relevant fixes, and create infrastructure such that the issues the feedback uncovered can not be made again. I'm only interested in general, complete fixes. I want to avoid fragility and make these checks extremey robust and reliable.

Feel free to do web searches to understand modern techniques, approaches, and best practices to this and any similar issues.

Please use sub-agents to accomplish these goals. Once a sub-agent is done, have another sub-agent review its work in an adversarial fashion. If there are any recommendations, have another sub-agent consider them and implement them. Repeat this process in a loop until all sub-agents achieve consensus that the result is incredibly high quality (110/100, exceptional work, absolutely zero issues, minor or otherwise) and does not require any revisions. I want 110% here, give it all you've got!

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 2, 2026

@copilot apply changes based on the comments in this thread

Can you parse through the feedback, determine if any o...

Applied the review-thread feedback in commit b969b7e: updated scripts/tests/test-validate-devcontainer-urls.sh to use fixed-string matching (grep -Fq --) for all Dockerfile literal contract checks (including ${...} URL templates), added a shared literal-assert helper, and improved failure diagnostics (needle + validator output). I also swept related checks in this test and converted them to the same robust literal pattern to prevent the whole regex-metacharacter class of issues. Targeted validations pass: bash scripts/tests/test-validate-devcontainer-urls.sh, bash scripts/tests/test-lint-meta-exclusions.sh, and pwsh -NoProfile -File scripts/lint-meta-files.ps1 -VerboseOutput.

@wallstop wallstop requested a review from Copilot April 2, 2026 13:10
Copilot AI changed the title Fix devcontainer publish failures on arm64 and add missing Unity meta for new regression test Fix devcontainer publish failures on arm64 and harden regression contract checks Apr 2, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/validate-devcontainer.yml Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@wallstop wallstop requested a review from Copilot April 2, 2026 13:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@wallstop wallstop merged commit c829dce into main Apr 2, 2026
21 checks passed
@wallstop wallstop deleted the copilot/fix-cicd-build-push-devcontainer branch April 2, 2026 13:31
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.

[Bug]: CI/CD (Build/Push DevContainer) Is Failing in main

3 participants