forked from kalzoo/tracing
-
Notifications
You must be signed in to change notification settings - Fork 0
chore: publish to internal crate registry #2
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
BatmanAoD
merged 12 commits into
rigetti-main
from
publish-tracing-error-to-rigetti-cargo
Jun 17, 2026
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d9d4c54
chore: fix 'clippy::manual_option_zip' in tracing-error (#3553)
martin-g b7087b3
chore: publish 'tracing-error' crate from 'rigetti-main' branch to 'r…
BatmanAoD 6125924
chore: switch from GHA to GL CI
BatmanAoD 5818130
GHA trigger GL CI
BatmanAoD 1c27720
explicitly sync fork before running CI
BatmanAoD b670f75
log more info
BatmanAoD 30af809
add more workflow rules
BatmanAoD 99495ff
auto-run jobs; project-path isn't secret
BatmanAoD 5501cdf
monitor pipeline status; use prereleases
BatmanAoD 71fa8ad
fix ID-extraction for busybox
BatmanAoD 89fde9f
include pipeline URL in error message
BatmanAoD b95a0d2
need to allow-dirty
BatmanAoD 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,9 @@ | ||
| [registries.rigetti-cargo] | ||
| index = "sparse+https://rigetti-733799784722.d.codeartifact.us-west-2.amazonaws.com/cargo/rigetti-cargo/" | ||
| # Unlike internal repos, this does not include the `--profile` argument, which is not used by CI. | ||
| # This makes it less convenient to use locally, but it should only be used for *publishing*, | ||
| # never for donwloading dependencies. | ||
| credential-provider = ["cargo:token-from-stdout", "sh", "-c", "aws codeartifact get-authorization-token --domain rigetti --domain-owner 733799784722 --region us-west-2 --query authorizationToken --output text"] | ||
|
|
||
| [registry] | ||
| default = "crates-io" |
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,92 @@ | ||
| name: Trigger GitLab CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| jobs: | ||
| trigger: | ||
| name: Trigger GitLab pipeline | ||
| runs-on: ubuntu-latest | ||
| container: gitlab/glab | ||
| steps: | ||
| - name: Sync mirror and wait for branch SHA | ||
| run: | | ||
| BRANCH="${{ github.head_ref }}" | ||
| EXPECTED_SHA="${{ github.event.pull_request.head.sha }}" | ||
| ENCODED_PATH="${GITLAB_PROJECT_PATH//\//%2F}" | ||
| TIMEOUT=300 | ||
| ELAPSED=0 | ||
|
|
||
| echo "Triggering mirror sync..." | ||
| glab api --method POST "projects/${ENCODED_PATH}/mirror/pull" | ||
| echo "" | ||
|
|
||
| echo "Waiting for GitLab branch '${BRANCH}' to reach SHA ${EXPECTED_SHA}..." | ||
| while true; do | ||
| ACTUAL_SHA=$(glab api "projects/${ENCODED_PATH}/repository/branches/${BRANCH}" 2>/dev/null \ | ||
| | jq -r '.commit.id // empty') | ||
| echo " elapsed=${ELAPSED}s actual_sha=${ACTUAL_SHA:-<not found>}" | ||
| if [ "$ACTUAL_SHA" = "$EXPECTED_SHA" ]; then | ||
| echo "SHA matched." | ||
| break | ||
| fi | ||
| if [ "$ELAPSED" -ge "$TIMEOUT" ]; then | ||
| echo "Timed out after ${TIMEOUT}s waiting for mirror to sync." | ||
| exit 1 | ||
| fi | ||
| sleep 10 | ||
| ELAPSED=$((ELAPSED + 10)) | ||
| done | ||
| env: | ||
| GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }} | ||
| GITLAB_HOST: gitlab.com | ||
| GITLAB_PROJECT_PATH: ${{ vars.GITLAB_PROJECT_PATH }} | ||
|
|
||
| - name: Trigger pipeline on mirrored branch | ||
| id: trigger | ||
| run: | | ||
| OUTPUT=$(glab ci run --branch "${{ github.head_ref }}" --repo "$GITLAB_PROJECT_PATH") | ||
| echo "$OUTPUT" | ||
| PIPELINE_ID=$(echo "$OUTPUT" | sed 's/.*id: \([0-9]*\).*/\1/') | ||
| echo "pipeline_id=${PIPELINE_ID}" >> "$GITHUB_OUTPUT" | ||
| env: | ||
| GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }} | ||
| GITLAB_HOST: gitlab.com | ||
| GITLAB_PROJECT_PATH: ${{ vars.GITLAB_PROJECT_PATH }} | ||
|
|
||
| - name: Monitor GitLab pipeline | ||
| run: | | ||
| PIPELINE_ID="${{ steps.trigger.outputs.pipeline_id }}" | ||
| ENCODED_PATH="${GITLAB_PROJECT_PATH//\//%2F}" | ||
| TIMEOUT=300 | ||
| ELAPSED=0 | ||
| POLL_INTERVAL=15 | ||
|
|
||
| echo "Monitoring pipeline ${PIPELINE_ID}..." | ||
| while true; do | ||
| RESPONSE=$(glab api "projects/${ENCODED_PATH}/pipelines/${PIPELINE_ID}" 2>/dev/null) | ||
| STATUS=$(echo "$RESPONSE" | jq -r '.status // empty') | ||
| PIPELINE_URL=$(echo "$RESPONSE" | jq -r '.web_url // empty') | ||
| echo " elapsed=${ELAPSED}s status=${STATUS:-<unknown>}" | ||
| case "$STATUS" in | ||
| success) | ||
| echo "Pipeline succeeded." | ||
| exit 0 | ||
| ;; | ||
| failed|canceled|skipped) | ||
| echo "Pipeline ended with status: ${STATUS}. ${PIPELINE_URL}" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| if [ "$ELAPSED" -ge "$TIMEOUT" ]; then | ||
| echo "Timed out after ${TIMEOUT}s waiting for pipeline to complete." | ||
| exit 1 | ||
| fi | ||
| sleep "$POLL_INTERVAL" | ||
| ELAPSED=$((ELAPSED + POLL_INTERVAL)) | ||
| done | ||
| env: | ||
| GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }} | ||
| GITLAB_HOST: gitlab.com | ||
| GITLAB_PROJECT_PATH: ${{ vars.GITLAB_PROJECT_PATH }} |
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,48 @@ | ||
| include: | ||
| - project: "rigetti/qcs/utilities/qcs-infrastructure" | ||
| ref: v0.1.1 | ||
| file: | ||
| - gitlab-ci/common.yaml | ||
| - gitlab-ci/gitlab.yaml | ||
| - gitlab-ci/rust.yaml | ||
|
|
||
| workflow: | ||
| rules: | ||
| - if: $CI_COMMIT_BRANCH == "rigetti-main" | ||
| - if: $CI_PIPELINE_SOURCE == "trigger" | ||
| - if: $CI_PIPELINE_SOURCE == "web" | ||
| - if: $CI_PIPELINE_SOURCE == "api" | ||
| - if: $CI_PIPELINE_SOURCE == "external" | ||
| - if: $CI_PIPELINE_SOURCE == "external_pull_request_event" | ||
|
|
||
| default: | ||
| !reference [.standard_defaults] | ||
|
|
||
| variables: | ||
| QCS_INFRASTRUCTURE_REF: v0.1.1 | ||
| RUST_CI_IMAGE_TAG: $QCS_INFRASTRUCTURE_REF | ||
| CLI_TOOLS_IMAGE_TAG: $QCS_INFRASTRUCTURE_REF | ||
|
|
||
| publish-tracing-error: | ||
| extends: [.cargo_publish_crate] | ||
| needs: [] | ||
| rules: | ||
| # Automatically run from rigetti-main | ||
| - if: $CI_COMMIT_BRANCH == "rigetti-main" | ||
| # Automatically run when triggered from GitHub, automatically via sync or via the API | ||
| - if: $CI_PIPELINE_SOURCE == "api" | ||
| - if: $CI_PIPELINE_SOURCE == "external_pull_request_event" | ||
| # Manually run from any other branch | ||
| - when: manual | ||
| before_script: | ||
| - !reference [.cargo_publish_crate, before_script] | ||
| script: | ||
| - | | ||
| if [ "$CI_COMMIT_BRANCH" != "rigetti-main" ]; then | ||
| sed -i "s/^version = \"\([^\"]*\)\"/version = \"\1-${CI_COMMIT_SHORT_SHA}\"/" tracing-error/Cargo.toml | ||
| echo "Patched version: $(grep '^version' tracing-error/Cargo.toml)" | ||
| dirty="--allow-dirty" | ||
| else | ||
| dirty="" | ||
| fi | ||
| - cargo publish $dirty -p tracing-error --registry rigetti-cargo |
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.
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.