-
Notifications
You must be signed in to change notification settings - Fork 0
feat(provider): migrate to v2 IaC dispatch (W-7/W-8 conformance + ApplyPlan) #61
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
234cd75
chore(deps): bump workflow to e2c582b (W-7 conformance + W-8 codemod)
intel352 53fbb5a
ci(plugin): codemod-report workflow uploads dry-run output as artifac…
intel352 f9f0022
refactor(provider): collapse Apply to wfctlhelpers.ApplyPlan
intel352 21a6d63
feat(provider): ValidatePlan for App Platform region-VPC constraints
intel352 6b4c552
feat(plugin): opt into computePlanVersion: v2
intel352 c47a1c3
feat(provider): add conformance test + extend ValidatePlan for databa…
intel352 43425f0
fix: Copilot review round 1 — 5 substantive findings
intel352 143cfb5
fix: Copilot review round 2 — 2 vpc_ref type-mismatch findings
intel352 2cdf023
fix: Copilot review round 3 — 4 deeper findings (vpc_ref UUID/templat…
intel352 a1e230b
fix: Copilot review round 4 — 3 polish findings (UUID case + t.Contex…
intel352 3758b47
fix: Copilot review round 5 — 2 findings (Initialize-ctx comment + un…
intel352 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| name: codemod-report | ||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| permissions: | ||
| # Copilot review #14 (round 4): scope to least privilege — | ||
| # contents:read for checkout, issues:write for the sticky PR | ||
| # comment (PR comments are issues at the GitHub API layer). The | ||
| # prior pull-requests:write grant was unused (no PR-state | ||
| # mutations) and inconsistent with the other workflows in this | ||
| # repo (ci.yml uses contents:read only). | ||
| contents: read | ||
| issues: write | ||
| env: | ||
| GOPRIVATE: github.com/GoCodeAlone/* | ||
| jobs: | ||
| codemod-report: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-go@v5 | ||
| with: | ||
| go-version-file: go.mod | ||
| - name: Configure Git for private repos | ||
| env: | ||
| RELEASES_TOKEN: ${{ secrets.RELEASES_TOKEN }} | ||
| run: | | ||
| if [ -n "${RELEASES_TOKEN}" ]; then | ||
| git config --global url."https://x-access-token:${RELEASES_TOKEN}@github.com/".insteadOf "https://github.com/" | ||
| fi | ||
| - name: Run iac-codemod refactor-apply (dry-run) | ||
| run: | | ||
| set -euo pipefail | ||
| WFCTL_VERSION="$(go list -m github.com/GoCodeAlone/workflow | awk '{print $2}')" | ||
| go run "github.com/GoCodeAlone/workflow/cmd/iac-codemod@${WFCTL_VERSION}" \ | ||
| refactor-apply -dry-run . > /tmp/codemod-report.md | ||
| # Short summary for the sticky PR comment. | ||
| head -30 /tmp/codemod-report.md > /tmp/codemod-summary.md | ||
| echo "" >> /tmp/codemod-summary.md | ||
| echo "_Full report (90-day retention) attached as workflow artifact._" >> /tmp/codemod-summary.md | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: codemod-report-${{ github.event.pull_request.number }} | ||
| path: /tmp/codemod-report.md | ||
| retention-days: 90 | ||
| - name: Comment summary on PR (first-party action SHA-pinned) | ||
| # rev5 — pin to commit SHA even though first-party. Tag mutability is a | ||
| # known risk; Renovate config tracks upstream releases via .github/renovate.json. | ||
| # | ||
| # Copilot review #5: PRs from forks run with a read-only GITHUB_TOKEN | ||
| # (per GitHub's pull_request workflow security model), so issues:create- | ||
| # comment + issues:update-comment fail 403. Skip the comment step on | ||
| # fork PRs — the artifact upload above still runs unconditionally so | ||
| # the report is reachable from the Actions tab without a comment. | ||
| if: github.event.pull_request.head.repo.fork == false | ||
| uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | ||
| with: | ||
| script: | | ||
| const fs = require('fs'); | ||
| const summary = fs.readFileSync('/tmp/codemod-summary.md', 'utf8'); | ||
| const marker = '<!-- codemod-report-sticky -->'; | ||
| const body = `${marker}\n${summary}`; | ||
| // Paginate to handle PRs with >30 comments (default page size). | ||
| const allComments = await github.paginate(github.rest.issues.listComments, { | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.issue.number, | ||
| per_page: 100, | ||
| }); | ||
| const existing = allComments.find(c => c.body && c.body.startsWith(marker)); | ||
| if (existing) { | ||
| await github.rest.issues.updateComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| comment_id: existing.id, | ||
| body, | ||
| }); | ||
| } else { | ||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.issue.number, | ||
| body, | ||
| }); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.