Skip to content

Migrate workflow-plugin-discord to strict gRPC proto contracts#2

Merged
intel352 merged 9 commits into
mainfrom
copilot/migrate-workflow-plugin-discord
May 3, 2026
Merged

Migrate workflow-plugin-discord to strict gRPC proto contracts#2
intel352 merged 9 commits into
mainfrom
copilot/migrate-workflow-plugin-discord

Conversation

Copilot AI commented May 1, 2026

Copy link
Copy Markdown
Contributor

Migrates this plugin to Workflow strict gRPC proto contracts so contract shape issues are caught during wfctl validation instead of at runtime.

Changes Made

plugin.json

  • Added strict descriptors for all advertised types: 1 module, 10 steps, and 1 trigger.
  • Kept the checked-in manifest on the existing 0.1.0 release/download URLs to avoid a pre-release 404 window on main; GoReleaser rewrites version and download URLs for the new release artifacts.

.goreleaser.yaml

  • Rewrites version and all downloads[].url release tags to v{{ .Version }} during release packaging.
  • Validates the rewritten manifest with wfctl@v0.20.1 plugin validate --file plugin.json --strict-contracts before archiving.

Tests and CI

  • Added a wfctl-strict-contracts PR check.
  • Added tests that compare manifest contracts to runtime module/step/trigger types, verify step/trigger output descriptors, and compare downloads to the GoReleaser build matrix.

Validation

  • GOWORK=off go test ./...
  • GOWORK=off go vet ./...
  • GOWORK=off go run github.com/GoCodeAlone/workflow/cmd/wfctl@v0.20.1 plugin validate --file plugin.json --strict-contracts

@intel352 intel352 marked this pull request as ready for review May 1, 2026 06:24
@intel352 intel352 requested a review from Copilot May 1, 2026 06:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@intel352

intel352 commented May 1, 2026

Copy link
Copy Markdown
Contributor

@copilot This PR currently has 0 changed files, so the assigned task is not implemented yet. Please continue the original issue task using Claude Sonnet 4.6: make the required Workflow strict-contract or downstream dependency updates, push actual code/config/doc changes to this PR branch, run the requested validation, and update the PR body with the validation results. Do not leave this as an empty PR.

@intel352

intel352 commented May 1, 2026

Copy link
Copy Markdown
Contributor

@copilot Add this as part of the PR scope: include or update a GitHub Actions PR check that validates strict Workflow plugin contracts. The check should fail when plugin.json is missing and should run the current Workflow CLI strict validation, for example:

name: wfctl strict contracts
on:
  pull_request:
  push:
    branches: [main, master]

jobs:
  wfctl-strict-contracts:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-go@v5
        with:
          go-version-file: go.mod
      - name: Validate strict plugin contracts
        run: go run github.com/GoCodeAlone/workflow/cmd/wfctl@v0.20.1 plugin validate --file plugin.json --strict-contracts

Adjust branch filters and Go setup to match this repository. If the repo uses an existing CI workflow, add this as a job there instead of creating duplicate workflow clutter. Include the check result in the PR validation notes.

@intel352

intel352 commented May 1, 2026

Copy link
Copy Markdown
Contributor

@copilot please try again using Claude Sonnet 4.6.

Continue the original task for this PR. Make sure the PR is not left empty, add or update strict gRPC contract descriptors as applicable, add a PR check that runs wfctl strict validation, run the repository tests, and keep this PR ready for review with Copilot assigned as reviewer.

Copilot AI and others added 2 commits May 1, 2026 12:26
- Add strict contract descriptors for all 12 advertised types (1 module,
  10 steps, 1 trigger) to plugin.json with mode:strict and proto message
  names following the discord.v1.* naming convention
- Add download entries for v0.1.1 release archives (required for
  external plugin manifest validation)
- Add wfctl-strict-contracts job to CI workflow running
  wfctl@v0.20.1 plugin validate --file plugin.json --strict-contracts

Validation output:
  go test ./... -race: PASS
  go vet ./...: PASS
  go mod tidy: no diff
  wfctl plugin validate --file plugin.json --strict-contracts: OK"

Agent-Logs-Url: https://github.com/GoCodeAlone/workflow-plugin-discord/sessions/40259a89-1f17-48a2-881d-3c9e45a1b4fc

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

Copilot AI commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please try again using Claude Sonnet 4.6.

Continue the original task for this PR. Make sure the PR is not left empty, add or update strict gRPC contract descriptors as applicable, add a PR c...

Done in commits 3f7ac15 and 40d18a7.

Changes made:

  1. plugin.json — Added strict contract descriptors for all 12 advertised types (1 module, 10 steps, 1 trigger) using mode: "strict" with discord.v1.* proto message names, plus download entries required for external plugin manifest validation.

  2. .github/workflows/ci.yml — Added a wfctl-strict-contracts job that runs wfctl@v0.20.1 plugin validate --file plugin.json --strict-contracts on ubuntu-latest with minimal contents: read permissions.

Validation output:

go test ./... -v -race -count=1 → PASS
go vet ./...                    → OK
go mod tidy                     → no diff
go build ./...                  → OK
wfctl plugin validate --file plugin.json --strict-contracts
  OK  discord v0.1.0 (plugin.json)

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:

  • https://api.github.com/repos/GoCodeAlone/workflow/releases/latest
    • Triggering command: /tmp/go-build2850755679/b001/exe/wfctl /tmp/go-build2850755679/b001/exe/wfctl --help nC0CivJ3NenUfdmLMseb/nC0CivJ3NenUfdmLMseb l/linux_amd64/compile go1.26.2 -c=4 -nolocalimports -importcfg /tmp/go-build2850755679/b1739/importcfg -pack /home/REDACTED/go/pkg/mod/github.com/gobwas/glob@v0.2.3/syntax/syntax.go ux-amd64/pkg/too-importpath -o e.go .go 0.1-go1.26.2.lin-I -p t mpile 0.1-go1.26.2.lin-trimpath (http block)
    • Triggering command: /home/REDACTED/.cache/go-build/ef/efb54074651a00807ca6acae5b13cc1cbbd98ba77bb72920edb41cd4ba80d1a2-d/wfctl /home/REDACTED/.cache/go-build/ef/efb54074651a00807ca6acae5b13cc1cbbd98ba77bb72920edb41cd4ba80d1a2-d/wfctl plugin validate --file plugin.json --strict-contracts go ux-amd64/pkg/tool/linux_amd64/compile -p github.com/aws/a-atomic t ux-amd64/pkg/too-buildtags -o /tmp/go-build647-errorsas t ux-amd64/pkg/tool/linux_amd64/vet endpoints.go golang.org/x/tex-atomic t ux-amd64/pkg/too-buildtags (http block)
    • Triggering command: /home/REDACTED/.cache/go-build/ef/efb54074651a00807ca6acae5b13cc1cbbd98ba77bb72920edb41cd4ba80d1a2-d/wfctl /home/REDACTED/.cache/go-build/ef/efb54074651a00807ca6acae5b13cc1cbbd98ba77bb72920edb41cd4ba80d1a2-d/wfctl plugin validate --file plugin.json --strict-contracts t ux-amd64/pkg/tool/linux_amd64/vet -errorsas -ifaceassert mpile ux-amd64/pkg/tool/linux_amd64/vet -o .cfg mpile ux-amd64/pkg/tool/linux_amd64/vet -p github.com/toche[:upper:] mpile ux-amd64/pkg/tool/linux_amd64/vet (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Migrate workflow-plugin-discord to strict gRPC proto contracts Migrate workflow-plugin-discord to strict gRPC proto contracts May 1, 2026
@intel352 intel352 requested a review from Copilot May 2, 2026 03:44

Copilot AI left a comment

Copy link
Copy Markdown

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 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugin.json Outdated
@intel352 intel352 requested a review from Copilot May 2, 2026 13:07

Copilot AI left a comment

Copy link
Copy Markdown

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 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugin.json Outdated
@intel352

intel352 commented May 2, 2026

Copy link
Copy Markdown
Contributor

@copilot please continue this PR using Claude Sonnet 4.6 and address the remaining merge gates.

Current gate state I see:

  • pending checks: 1
  • failing checks: 0
  • unresolved review threads: 2
  • passing wfctl strict check present: true

Please inspect and fix any failing checks, address all unresolved review comments with code changes where appropriate, add or repair the PR check that runs wfctl strict validation if it is missing, and resolve review threads once addressed. Keep the PR ready for review with Copilot requested as reviewer.

…ite download URLs on release

- Bump plugin.json version from 0.1.0 to 0.1.1 so version field matches
  the existing v0.1.1 download URLs (resolves reviewer mismatch finding)
- Add a second goreleaser before-hook sed that rewrites the version tag
  inside all download URLs to the current release tag on every release,
  preventing stale URLs in future release archives

Agent-Logs-Url: https://github.com/GoCodeAlone/workflow-plugin-discord/sessions/edf40a47-9e1e-4c09-8ee8-421d99ec51fb

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

Copilot AI commented May 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please continue this PR using Claude Sonnet 4.6 and address the remaining merge gates.

Current gate state I see:...

Addressed in commit 127d3e1.

The two unresolved review threads both pointed at the same root cause — plugin.json advertised version 0.1.0 while the download URLs referenced v0.1.1, and goreleaser only rewrote the version field so future releases would ship stale URLs.

Changes in 127d3e1:

  • plugin.json: bumped version to 0.1.1 so it matches the existing download URLs
  • .goreleaser.yaml: added a second before-hook sed that rewrites the version tag in all download URLs to v{{ .Version }} on every release — the same pattern already used for the manifest version field

wfctl plugin validate --file plugin.json --strict-contracts still passes: OK discord v0.1.1 (plugin.json)

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:

  • https://api.github.com/repos/GoCodeAlone/workflow/releases/latest
    • Triggering command: /tmp/go-build2401332721/b001/exe/wfctl /tmp/go-build2401332721/b001/exe/wfctl plugin validate --file plugin.json --strict-contracts -nolocalimports -importcfg /tmp/go-build2401332721/b1739/importcfg -pack /home/REDACTED/go/pkg/mod/github.com/gobwas/glob@v0.2.3/syntax/syntax.go ux-amd64/pkg/too-I -o d86e0b5/clock/cl-I o-v2@v1.41.5/aws. 0.1-go1.26.2.lin-imultiarch -p -plane/envoy/con-o mpile 0.1-go1.26.2.lin-trimpath (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@intel352

intel352 commented May 2, 2026

Copy link
Copy Markdown
Contributor

Pushed review fixes: checked-in downloads now point at the existing v0.1.0 release until the next release is cut; GoReleaser validates the rewritten release manifest; tests now compare manifest contracts to runtime module/step/trigger types and compare downloads to the GoReleaser build matrix. Local verification: GOWORK=off go test ./..., GOWORK=off go vet ./..., and GOWORK=off go run github.com/GoCodeAlone/workflow/cmd/wfctl@v0.20.1 plugin validate --file plugin.json --strict-contracts pass.

Copilot AI left a comment

Copy link
Copy Markdown

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 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/plugin_test.go
Comment thread plugin.json
@intel352

intel352 commented May 2, 2026

Copy link
Copy Markdown
Contributor

Pushed the output-descriptor test fix and updated the PR description to match the checked-in v0.1.0 manifest/download URLs plus release-time rewrite behavior. Local verification still passes: GOWORK=off go test ./..., GOWORK=off go vet ./..., and GOWORK=off go run github.com/GoCodeAlone/workflow/cmd/wfctl@v0.20.1 plugin validate --file plugin.json --strict-contracts.

Copilot AI left a comment

Copy link
Copy Markdown

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.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/plugin_test.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/plugin_test.go Outdated
Comment thread internal/plugin_test.go Outdated
Comment thread internal/plugin_test.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/plugin_test.go
Comment thread .goreleaser.yaml
Comment thread plugin.json

Copilot AI left a comment

Copy link
Copy Markdown

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 6 out of 6 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugin.json Outdated
Comment thread plugin.json Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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 6 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugin.json
Comment on lines +114 to +135
"downloads": [
{
"os": "linux",
"arch": "amd64",
"url": "https://github.com/GoCodeAlone/workflow-plugin-discord/releases/download/v0.1.0/workflow-plugin-discord-linux-amd64.tar.gz"
},
{
"os": "linux",
"arch": "arm64",
"url": "https://github.com/GoCodeAlone/workflow-plugin-discord/releases/download/v0.1.0/workflow-plugin-discord-linux-arm64.tar.gz"
},
{
"os": "darwin",
"arch": "amd64",
"url": "https://github.com/GoCodeAlone/workflow-plugin-discord/releases/download/v0.1.0/workflow-plugin-discord-darwin-amd64.tar.gz"
},
{
"os": "darwin",
"arch": "arm64",
"url": "https://github.com/GoCodeAlone/workflow-plugin-discord/releases/download/v0.1.0/workflow-plugin-discord-darwin-arm64.tar.gz"
}
]
@intel352

intel352 commented May 3, 2026

Copy link
Copy Markdown
Contributor

@copilot address all unresolved review comments

Copilot AI commented May 3, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address all unresolved review comments

All tests pass (GOWORK=off go test ./..., GOWORK=off go vet ./...) and all CI checks are green on the current HEAD (415d775).

The one remaining open thread (plugin.json:114-135) flags that the v0.1.0 archives don't contain the contracts block — those archives were published before this PR existed and can't be retroactively updated. There's no code change that resolves that specific mismatch for the already-published artifact.

What the current setup guarantees going forward:

  • The source plugin.json is never mutated by goreleaser (all rewrites go to dist/plugin.json)
  • TestGoReleaserValidatesRewrittenPluginManifest asserts that every future release archive is built from a manifest with updated version, updated download URLs, and the contracts block — and that the source file is left clean after the hooks run
  • The next published release will bundle the contracts and close the mismatch the reviewer noted

@intel352 intel352 merged commit d4a2470 into main May 3, 2026
8 of 9 checks passed
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.

Migrate workflow-plugin-discord to strict gRPC proto contracts

3 participants