-
Notifications
You must be signed in to change notification settings - Fork 12
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
Get ROCK image right tag considering the latest merged rock files #217
Conversation
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.
LGTM :) Thanks!
54f82d3
54f82d3
to
9b705a0
Compare
The problem of using For example, the commit in main branch is canonical/synapse-operator@7defdb4, but the corresponding commit in pull request is canonical/synapse-operator@1e13c04. Unfortunately, tests inside this repository don't reflect that situation. |
I think something like this should work: # Get commit info
TREE_SHA=$(gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/commits/${GITHUB_SHA} \
--jq '.commit.tree.sha')
# Get workflow from this specific tree id
RUN_ID=$(gh api \
--method GET \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/actions/runs \
-f path=.github/workflows/integration_test.yaml \
-f status=completed \
-f event=pull_request \
--jq "[
.workflow_runs[]
| select(.path == \".github/workflows/integration_test.yaml\")
| select(.head_commit.tree_id == \"$TREE_SHA\")
] | max_by(.updated_at) | .id") |
Thanks!! |
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.
LGTM!
Applicable spec:
Overview
What happened in Synapse:
24 Nov: I submitted a WIP PR that changes the ROCK images canonical/synapse-operator#111
27 Nov: Publish to Edge workflow sucessfully ran with merged changes (update jsonschema)
27 Nov: I refreshed Synapse charm in production to apply the fix regarding nginx pebble ready event (23 Nov) + this last one regarding jsonschema
For my huge surprise: Synapse image is running the latest Synapse version as was changed in the WIP PR
Rationale
Make publish charm get the latest image from the latest merged PR and not the latest uploaded.
Workflow Changes
Checklist
urgent
,trivial
,complex
)