From 699f7ea9fe82be5eb38a395fb0eeb913ca5711a8 Mon Sep 17 00:00:00 2001 From: Kyle J Strand Date: Fri, 29 May 2026 13:46:59 -0600 Subject: [PATCH 1/7] chore: publish 'tracing-error' crate from 'rigetti-main' branch to 'rigetti-cargo' registry --- .cargo/config.toml | 9 +++++++ .github/workflows/publish-tracing-error.yml | 27 +++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .cargo/config.toml create mode 100644 .github/workflows/publish-tracing-error.yml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000000..1a3e354f93 --- /dev/null +++ b/.cargo/config.toml @@ -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" diff --git a/.github/workflows/publish-tracing-error.yml b/.github/workflows/publish-tracing-error.yml new file mode 100644 index 0000000000..be0a4aeba6 --- /dev/null +++ b/.github/workflows/publish-tracing-error.yml @@ -0,0 +1,27 @@ +name: Publish tracing-error + +on: + push: + branches: + - rigetti-main + +jobs: + publish: + name: Publish tracing-error to rigetti-cargo + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_ROLE_ARN }} + aws-region: us-west-2 + + - name: Publish tracing-error + run: cargo publish -p tracing-error --registry rigetti-cargo From a15cdb05f40281a0c9fc9a0552fc7b304b5ac226 Mon Sep 17 00:00:00 2001 From: Kyle J Strand Date: Mon, 15 Jun 2026 13:39:36 -0600 Subject: [PATCH 2/7] chore: switch from GHA to GL CI --- .github/workflows/publish-tracing-error.yml | 27 ----------------- .gitlab-ci.yml | 32 +++++++++++++++++++++ 2 files changed, 32 insertions(+), 27 deletions(-) delete mode 100644 .github/workflows/publish-tracing-error.yml create mode 100644 .gitlab-ci.yml diff --git a/.github/workflows/publish-tracing-error.yml b/.github/workflows/publish-tracing-error.yml deleted file mode 100644 index be0a4aeba6..0000000000 --- a/.github/workflows/publish-tracing-error.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Publish tracing-error - -on: - push: - branches: - - rigetti-main - -jobs: - publish: - name: Publish tracing-error to rigetti-cargo - runs-on: ubuntu-latest - permissions: - id-token: write - contents: read - steps: - - uses: actions/checkout@v4 - - - uses: dtolnay/rust-toolchain@stable - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - aws-region: us-west-2 - - - name: Publish tracing-error - run: cargo publish -p tracing-error --registry rigetti-cargo diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000..a5369638cb --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,32 @@ +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" + +default: + !reference [.standard_defaults] + +variables: + QCS_INFRASTRUCTURE_REF: v0.0.17 + 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" + # Manually run from any other branch + - when: manual + before_script: + - !reference [.cargo_publish_crate, before_script] + script: + - cargo publish -p tracing-error --registry rigetti-cargo From 58db9075d2aa9423f751229b08ce61d1f72088e1 Mon Sep 17 00:00:00 2001 From: Kyle J Strand Date: Mon, 15 Jun 2026 13:54:42 -0600 Subject: [PATCH 3/7] GHA trigger GL CI --- .github/workflows/trigger-gitlab-ci.yml | 18 ++++++++++++++++++ .gitlab-ci.yml | 4 +++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/trigger-gitlab-ci.yml diff --git a/.github/workflows/trigger-gitlab-ci.yml b/.github/workflows/trigger-gitlab-ci.yml new file mode 100644 index 0000000000..31e9fb9a84 --- /dev/null +++ b/.github/workflows/trigger-gitlab-ci.yml @@ -0,0 +1,18 @@ +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: Trigger pipeline on mirrored branch + run: glab ci run --branch "${{ github.head_ref }}" --repo "$GITLAB_PROJECT_PATH" + env: + GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }} + GITLAB_HOST: gitlab.com + GITLAB_PROJECT_PATH: ${{ secrets.GITLAB_PROJECT_PATH }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a5369638cb..79b757647b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,12 +9,14 @@ include: workflow: rules: - if: $CI_COMMIT_BRANCH == "rigetti-main" + - if: $CI_PIPELINE_SOURCE == "trigger" + - if: $CI_PIPELINE_SOURCE == "web" default: !reference [.standard_defaults] variables: - QCS_INFRASTRUCTURE_REF: v0.0.17 + QCS_INFRASTRUCTURE_REF: v0.1.1 RUST_CI_IMAGE_TAG: $QCS_INFRASTRUCTURE_REF CLI_TOOLS_IMAGE_TAG: $QCS_INFRASTRUCTURE_REF From e9287b05e5844065b0af24834e4ed4d3a22e8c41 Mon Sep 17 00:00:00 2001 From: Kyle J Strand Date: Mon, 15 Jun 2026 14:17:58 -0600 Subject: [PATCH 4/7] chore: try creating new commit to see if it gets mirrored From 5c9666a0388bf7398b8db6196f7c9c9626a9136a Mon Sep 17 00:00:00 2001 From: Kyle J Strand Date: Mon, 15 Jun 2026 14:19:58 -0600 Subject: [PATCH 5/7] explicitly sync fork before running CI --- .github/workflows/trigger-gitlab-ci.yml | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/trigger-gitlab-ci.yml b/.github/workflows/trigger-gitlab-ci.yml index 31e9fb9a84..1d8783e209 100644 --- a/.github/workflows/trigger-gitlab-ci.yml +++ b/.github/workflows/trigger-gitlab-ci.yml @@ -10,6 +10,37 @@ jobs: 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 "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') + 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: ${{ secrets.GITLAB_PROJECT_PATH }} + - name: Trigger pipeline on mirrored branch run: glab ci run --branch "${{ github.head_ref }}" --repo "$GITLAB_PROJECT_PATH" env: From 0deaa6b3b7ffdaa88490dbd82badce10f290c9f4 Mon Sep 17 00:00:00 2001 From: Kyle J Strand Date: Mon, 15 Jun 2026 14:30:41 -0600 Subject: [PATCH 6/7] log more info --- .github/workflows/trigger-gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/trigger-gitlab-ci.yml b/.github/workflows/trigger-gitlab-ci.yml index 1d8783e209..51d014d7b7 100644 --- a/.github/workflows/trigger-gitlab-ci.yml +++ b/.github/workflows/trigger-gitlab-ci.yml @@ -20,11 +20,13 @@ jobs: 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:-}" if [ "$ACTUAL_SHA" = "$EXPECTED_SHA" ]; then echo "SHA matched." break From f2876e224eae9ddb0e0d18a1878287a73a1c9121 Mon Sep 17 00:00:00 2001 From: Kyle J Strand Date: Mon, 15 Jun 2026 14:46:44 -0600 Subject: [PATCH 7/7] test another commit