Repository navigation
Check stable-line pull requests with Patch QA and Patch provenance #9196
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
Open
craigmichaelmartin
wants to merge
14
commits into
main
Choose a base branch
from
patch-qa-and-provenance
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,100
−30
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
70e5333
Check stable-line pull requests with Patch QA and Patch provenance
craigmichaelmartin 74e567d
Check versioned files line by line in Patch provenance
craigmichaelmartin 477ca19
Tighten Patch provenance for backports and Version Packages changelogs
craigmichaelmartin 3a795af
Compare Patch QA's files in their own job, and share the tarball build
craigmichaelmartin c8fe61c
Rebuild Version Packages changelog sections with the line's own forma…
craigmichaelmartin 1b13f65
Run Patch provenance on pull_request
craigmichaelmartin 989388d
Require a backport to be all of main's commit
craigmichaelmartin a90e81c
Load the QA tarball build action from the workflow's own commit
craigmichaelmartin 60ea9d4
Refuse a fix the line already has, and bumps outside patch rules
craigmichaelmartin 9f8a972
Refuse a backport that changes only changesets
craigmichaelmartin 347984b
Smoke-test command code that help doesn't load
craigmichaelmartin 7ebc80f
Check a backport against what landed on main, and every bump's report…
craigmichaelmartin a2ba047
Check that main still has a backport's fix, and a consumed changeset'…
craigmichaelmartin 41d94ec
Merge main into patch-qa-and-provenance
craigmichaelmartin 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,53 @@ | ||
| name: 'Build the @shopify/cli tarball' | ||
| description: 'Builds the @shopify/cli tarball that a release of the checked-out commit would publish, and uploads it as an artifact' | ||
| inputs: | ||
| artifact-name: | ||
| required: true | ||
| description: 'Name of the artifact to upload the tarball as' | ||
| outputs: | ||
| tarball: | ||
| description: 'File name of the tarball in packages/cli' | ||
| value: ${{ steps.pack.outputs.tarball }} | ||
| version: | ||
| description: 'Version of @shopify/cli in the tarball' | ||
| value: ${{ steps.pack.outputs.version }} | ||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Setup deps | ||
| uses: ./.github/actions/setup-cli-deps | ||
| with: | ||
| node-version: 24.22.1 | ||
|
|
||
| # The same build the release runs, before it publishes. | ||
| - name: Bundle | ||
| shell: bash | ||
| run: pnpm bundle-for-release | ||
| env: | ||
| SHOPIFY_CLI_BUILD_REPO: ${{ github.repository }} | ||
|
|
||
| # The release's prepack also generates the manifest and copies the README. Its error-reporting | ||
| # source map upload is left out, and the tarball excludes source maps either way. | ||
| - name: Pack @shopify/cli | ||
| id: pack | ||
| shell: bash | ||
| working-directory: packages/cli | ||
| run: | | ||
| set -euo pipefail | ||
| pnpm oclif manifest | ||
| cp ../../README.md README.md | ||
| TARBALL=$(npm pack --ignore-scripts | tail -n 1) | ||
| VERSION=$(tar -xzOf "$TARBALL" package/package.json | node -p 'JSON.parse(require("node:fs").readFileSync(0, "utf8")).version') | ||
| { | ||
| echo "tarball=$TARBALL" | ||
| echo "version=$VERSION" | ||
| } >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Upload the tarball | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ inputs.artifact-name }} | ||
| path: packages/cli/${{ steps.pack.outputs.tarball }} | ||
| if-no-files-found: error | ||
| # The tarball is already compressed. | ||
| compression-level: 0 |
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,93 @@ | ||
| #!/usr/bin/env bash | ||
| # Runs the checks that need no Shopify account against the globally installed `shopify`. | ||
| # Works on Linux, macOS and Git Bash on Windows. | ||
| # | ||
| # Usage: smoke-test-cli.sh <expected-version> | ||
| set -euo pipefail | ||
|
|
||
| if [ "$#" -ne 1 ] || [ -z "$1" ]; then | ||
| echo "Usage: $0 <expected-version>" >&2 | ||
| exit 2 | ||
| fi | ||
| EXPECTED_VERSION="$1" | ||
|
|
||
| # No color codes in the output, no prompts, no analytics, and no auto-upgrade, which the CLI skips | ||
| # when CI is set. | ||
| export NO_COLOR=1 | ||
| export SHOPIFY_CLI_NO_ANALYTICS=1 | ||
| export CI=1 | ||
|
|
||
| WORK_DIR=$(mktemp -d) | ||
| trap 'rm -rf "$WORK_DIR"' EXIT | ||
| cd "$WORK_DIR" | ||
|
|
||
| CURRENT_CASE="" | ||
| trap 'echo "::error::Smoke test failed: $CURRENT_CASE"' ERR | ||
|
|
||
| start_case() { | ||
| CURRENT_CASE="$1" | ||
| echo | ||
| echo "=== $1" | ||
| } | ||
|
|
||
| fail() { | ||
| echo "::error::$CURRENT_CASE: $1" | ||
| exit 1 | ||
| } | ||
|
|
||
| # A command's JSON output schema names its own result type beside the shared error and event types. | ||
| check_schema() { | ||
| node -e 'const schema = JSON.parse(require("fs").readFileSync(process.argv[1], "utf8")); if (!schema.definitions?.Result) process.exit(1)' "$1" || | ||
| fail "$1 isn't the command's JSON output schema" | ||
| } | ||
|
|
||
| start_case "shopify version is $EXPECTED_VERSION" | ||
| VERSION_OUTPUT=$(shopify version) | ||
| echo "$VERSION_OUTPUT" | ||
| # Exact match on one whitespace-separated token, so 5.1.1 doesn't match 5.1.10. | ||
| if ! tr -s ' \t\r' '\n' <<< "$VERSION_OUTPUT" | grep -Fxq "$EXPECTED_VERSION"; then | ||
| fail "expected version $EXPECTED_VERSION, got: $VERSION_OUTPUT" | ||
| fi | ||
|
|
||
| start_case "shopify help" | ||
| shopify help | ||
|
|
||
| start_case "shopify commands" | ||
| COMMANDS_OUTPUT=$(shopify commands) | ||
| echo "Listed $(wc -l <<< "$COMMANDS_OUTPUT" | tr -d ' ') lines of commands" | ||
|
|
||
| for TOPIC in app theme hydrogen; do | ||
| start_case "shopify $TOPIC --help" | ||
| shopify "$TOPIC" --help | ||
| done | ||
|
|
||
| # Help comes from the oclif manifest, so it doesn't load a command's code. --json-schema does, from | ||
| # the plugin that provides the command, and needs no Shopify account or project. | ||
| start_case "shopify hydrogen check --json-schema" | ||
| shopify hydrogen check --json-schema > hydrogen-check-schema.json | ||
| check_schema hydrogen-check-schema.json | ||
|
|
||
| start_case "shopify app info --json-schema" | ||
| shopify app info --json-schema > app-info-schema.json | ||
| check_schema app-info-schema.json | ||
|
|
||
| # A pinned Skeleton release, so a newer one can't fail an older line's theme check. A URL with a | ||
| # tag takes the Git-only path: the default Skeleton URL looks up its release through the GitHub | ||
| # API, whose unauthenticated rate limit is shared by every machine behind the same address. | ||
| start_case "shopify theme init" | ||
| shopify theme init qa-theme --clone-url https://github.com/Shopify/skeleton-theme#v1.0.0 | ||
| [ -f qa-theme/config/settings_schema.json ] || fail "qa-theme/config/settings_schema.json is missing" | ||
|
|
||
| # The default fail level, error, lets warnings and suggestions pass. | ||
| start_case "shopify theme check" | ||
| shopify theme check --path qa-theme --fail-level error | ||
|
|
||
| start_case "shopify theme package" | ||
| shopify theme package --path qa-theme | ||
| ZIPS=$(find qa-theme -maxdepth 1 -name '*.zip') | ||
| [ -n "$ZIPS" ] || fail "no .zip file in qa-theme" | ||
| echo "Packaged $ZIPS" | ||
|
|
||
| CURRENT_CASE="" | ||
| echo | ||
| echo "All smoke tests passed for @shopify/cli $EXPECTED_VERSION" | ||
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.