-
Notifications
You must be signed in to change notification settings - Fork 3
ci: run the wire-compat gate (published pg-core opens HEAD-sealed samples) #266
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
Changes from all commits
394ef02
62f2585
a9138a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,6 +3,10 @@ on: | |||||||||||||||
| branches: | ||||||||||||||||
| - main | ||||||||||||||||
| pull_request: | ||||||||||||||||
| # `edited` included for base retargets (e.g. a stacked PR's base merging): | ||||||||||||||||
| # paths-filter's verdict depends on the base, and without `edited` a stale | ||||||||||||||||
| # verdict stays attached to the unchanged head sha. | ||||||||||||||||
| types: [opened, synchronize, reopened, edited] | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keeping The cost is that Either of these settles it, both non-blocking: concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: trueor, on the expensive jobs only,
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Keeping concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}at the top of build.yml caps it at one live run per PR while leaving main pushes uncancelled. Non-blocking. |
||||||||||||||||
| branches: | ||||||||||||||||
| - main | ||||||||||||||||
| workflow_dispatch: | ||||||||||||||||
|
|
@@ -90,3 +94,101 @@ jobs: | |||||||||||||||
| retry_on: error | ||||||||||||||||
| timeout_minutes: 20 | ||||||||||||||||
| command: wasm-pack test --release --headless --\${{ matrix.browser }} ./pg-wasm | ||||||||||||||||
|
|
||||||||||||||||
| # --------------------------------------------------------------------------- | ||||||||||||||||
| # Wire compatibility: HEAD-sealed containers must open with published readers | ||||||||||||||||
| # (#251 / #260). #261 adds a wire-compat-js job that downloads the artifact | ||||||||||||||||
| # this job uploads. | ||||||||||||||||
| # | ||||||||||||||||
| # The path filter is a step, not an `on: paths:` key, on purpose: a job that | ||||||||||||||||
| # is skipped by a path filter never reports, so a required check would sit | ||||||||||||||||
| # pending forever on PRs that do not touch the wire surface. This shape always | ||||||||||||||||
| # reports and only does the expensive work when it needs to. | ||||||||||||||||
| # --------------------------------------------------------------------------- | ||||||||||||||||
| wire-compat-rust: | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No permissions:
contents: read
pull-requests: readGood news on the failure mode: the action throws rather than falling back, so a missing permission reds the job instead of silently returning zero changed files. Non-blocking.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Non-blocking, but cheapest to do while you are here: this job never surfaces the filter verdict, so a downstream job cannot read it. That is what forces Copies of a gate's trigger list drift in the dangerous direction: add wire-compat-rust:
name: Wire compat (published pg-core)
runs-on: ubuntu-latest
outputs:
wire: ${{ steps.changes.outputs.wire }}That turns #261's half into a one-line |
||||||||||||||||
| name: Wire compat (published pg-core) | ||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||
| permissions: | ||||||||||||||||
| contents: read | ||||||||||||||||
| pull-requests: read # paths-filter reads the PR's changed files | ||||||||||||||||
| steps: | ||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||
| # SHA-pinned as the one action new to this repo; the rest follow the | ||||||||||||||||
| # file's existing floating-ref convention. | ||||||||||||||||
| - uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2 | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit, and it partly contradicts a note in my own memory that I have now corrected. I read So a manual dispatch on If dispatch should force the gate, |
||||||||||||||||
| id: changes | ||||||||||||||||
| with: | ||||||||||||||||
| filters: | | ||||||||||||||||
| wire: | ||||||||||||||||
| - 'pg-core/**' | ||||||||||||||||
| - 'pg-wasm/**' | ||||||||||||||||
| - 'pg-compat/**' | ||||||||||||||||
| # pg-core has no lockfile of its own: the bytes HEAD seals are a | ||||||||||||||||
| # function of the ROOT lockfile (a bincode-next/ibe/serde bump | ||||||||||||||||
| # touches only these two files). Root Cargo.toml also holds the | ||||||||||||||||
| # exclude list that keeps pg-compat on crates.io pg-core. | ||||||||||||||||
| - 'Cargo.lock' | ||||||||||||||||
| - 'Cargo.toml' | ||||||||||||||||
| - '.github/workflows/build.yml' | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Blocking. The
So: a
Suggested change
Root |
||||||||||||||||
|
|
||||||||||||||||
| - if: steps.changes.outputs.wire == 'true' | ||||||||||||||||
| uses: dtolnay/rust-toolchain@stable | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit on the pinning rationale, not the pin. The comment above pins Consistent with the rest of |
||||||||||||||||
| with: | ||||||||||||||||
| components: clippy, rustfmt | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Leftover from the lint split: this job no longer runs fmt or clippy, so
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Carried forward from the last round and still open — flagging once more, still non-blocking. After the lint split this job runs only
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These two components are installed but never used: after the lint split this job runs only |
||||||||||||||||
|
|
||||||||||||||||
| - name: Seal the sample set with HEAD | ||||||||||||||||
| id: seal | ||||||||||||||||
| if: steps.changes.outputs.wire == 'true' | ||||||||||||||||
| shell: bash | ||||||||||||||||
| run: | | ||||||||||||||||
| cargo run --locked -p pg-core --features stream --example seal-samples \ | ||||||||||||||||
| -- "$RUNNER_TEMP/wire-compat-artifacts" | ||||||||||||||||
|
|
||||||||||||||||
| # Hand-off to wire-compat-js (#261). Uploaded before the reader runs so a | ||||||||||||||||
| # red gate still leaves the bytes that broke it. | ||||||||||||||||
| - name: Upload the sample set | ||||||||||||||||
| if: steps.seal.outcome == 'success' | ||||||||||||||||
| uses: actions/upload-artifact@v4 | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Blocking, one line. The failure mode is exactly the path this gate exists to walk. Attempt 1: seal OK, upload OK, This is a well-trodden v4 problem, not a theory — a search for the conflict text plus "re-run" returns 36 issues/PRs, including several whose whole content is this fix: uses: actions/upload-artifact@v4
with:
name: wire-compat-artifacts-${{ github.event.pull_request.head.sha || github.sha }}
path: ${{ runner.temp }}/wire-compat-artifacts
retention-days: 7
overwrite: true
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Version skew with the repo's own convention: |
||||||||||||||||
| with: | ||||||||||||||||
| name: wire-compat-artifacts-${{ github.event.pull_request.head.sha || github.sha }} | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The round-3 item, downgraded to a note. What I could not settle is whether artifacts from a previous attempt stay attached to the run: actions/upload-artifact#585 shows prior-attempt artifacts becoming inaccessible, but its repro used attempt-numbered names. If they do stay attached, "Re-run failed jobs" after a flaky reader step dies at the upload before the reader ever runs. |
||||||||||||||||
| path: ${{ runner.temp }}/wire-compat-artifacts | ||||||||||||||||
| retention-days: 7 | ||||||||||||||||
|
|
||||||||||||||||
| - name: Open it with published pg-core | ||||||||||||||||
| if: steps.changes.outputs.wire == 'true' | ||||||||||||||||
| shell: bash | ||||||||||||||||
| env: | ||||||||||||||||
| PG_COMPAT_ARTIFACTS: ${{ runner.temp }}/wire-compat-artifacts | ||||||||||||||||
| run: cargo test --manifest-path pg-compat/Cargo.toml --locked | ||||||||||||||||
|
|
||||||||||||||||
| # pg-compat is outside the workspace, so the per-crate fmt/clippy matrices do | ||||||||||||||||
| # not cover it. Kept separate from wire-compat-rust on purpose: a new stable | ||||||||||||||||
| # rustc lint must not red a required check named after wire compatibility, | ||||||||||||||||
| # nor pre-empt the seal/read steps that answer it. | ||||||||||||||||
| pg-compat-lint: | ||||||||||||||||
| name: Lint pg-compat | ||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||
| permissions: | ||||||||||||||||
| contents: read | ||||||||||||||||
| pull-requests: read | ||||||||||||||||
| steps: | ||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||
| - uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2 | ||||||||||||||||
| id: changes | ||||||||||||||||
| with: | ||||||||||||||||
| filters: | | ||||||||||||||||
| wire: | ||||||||||||||||
| - 'pg-compat/**' | ||||||||||||||||
| - 'Cargo.lock' | ||||||||||||||||
| - 'Cargo.toml' | ||||||||||||||||
| - '.github/workflows/build.yml' | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The two |
||||||||||||||||
| - if: steps.changes.outputs.wire == 'true' | ||||||||||||||||
| uses: dtolnay/rust-toolchain@stable | ||||||||||||||||
| with: | ||||||||||||||||
| components: clippy, rustfmt | ||||||||||||||||
| - name: Format pg-compat | ||||||||||||||||
| if: steps.changes.outputs.wire == 'true' | ||||||||||||||||
| run: cargo fmt --manifest-path pg-compat/Cargo.toml --all -- --check | ||||||||||||||||
| - name: Clippy pg-compat | ||||||||||||||||
| if: steps.changes.outputs.wire == 'true' | ||||||||||||||||
| run: cargo clippy --manifest-path pg-compat/Cargo.toml --all-targets --locked -- -D warnings | ||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -141,11 +141,12 @@ stream-multi-segment.bin/.plain | |
|
|
||
| ### Consuming the set from another job | ||
|
|
||
| One thing for [#261] to plan around. The proposed `wire-compat-rust` job seals | ||
| One thing for [#261] to plan around. The `wire-compat-rust` job seals | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The fix is correct and I verified the end state rather than just the text: the artifact this PR's run actually produced is Only the reflow is left ragged. This paragraph otherwise wraps at 74-76 columns, but dropping "proposed" left this line at 69 and the longer artifact name orphaned |
||
| and uploads only when the PR touches the wire surface; on every other PR it | ||
| reports success with no artifact attached. A `wire-compat-js` job with | ||
| `needs: wire-compat-rust` that downloads | ||
|
Comment on lines
+144
to
147
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Docs still name the old artifact, three lines below this one: The job now uploads Mirror the |
||
| `wire-compat-artifacts-${{ github.sha }}` unconditionally therefore hard-fails | ||
| `wire-compat-artifacts-${{ github.event.pull_request.head.sha || github.sha }}` | ||
| unconditionally therefore hard-fails | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Re-wrap left ragged by the edit: this paragraph wraps at 69-79 columns on every other line (144-148, 150-151), but line 149 is 36 characters. Rewrapping 147-149 as |
||
| on unrelated PRs rather than skipping. Repeat the same path condition on the | ||
| download, or seal locally in the JS job instead of consuming the artifact. | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep
edited— it is doing real work. A base retarget fireseditedand none of the three default types, so without it this job's paths-filter verdict would stay pinned to the old base while GitHub reports the check as current. The comment is right.The cost is the other half of
edited: it also fires on every title and description edit, and build.yml has noconcurrencygroup, so each edit re-runs the whole workflow (4x Test, 4x Clippy, 4x Format, plus 3 wasm browser jobs including a macOS runner) with nothing cancelling the superseded run. Worth pairing with:Pre-existing gap rather than something this PR introduced;
editedjust makes it cheap to hit. Non-blocking.