Skip to content
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

Add CTC check prior to tag promotion #322

Merged
merged 5 commits into from
Aug 19, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,25 @@ jobs:
done
done

ctc-check:
name: Obtain CTC Lock
if: github.ref_type == 'tag'
runs-on: ubuntu-24.04
steps:
- name: Obtain CTC Lock via TPS API
run: |
curl -sS -X PUT \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshwlewis This check currently won't actually block releases, since CTC uses non-HTTP-200 responses to denote blocking a lock (https://github.com/heroku/tps/blob/master/docs/ctc.md#responses), and Curl ignores these unless the --fail argument is used.

eg compare to the Cheverny implementation, which checks for HTTP 200/201:
https://github.com/heroku/cheverny/blob/f27b132b8b829b16d2161977f00316faf0f06520/lib/mediators/stack/ctc_checker.rb#L27

For bonus points, we should probably also use --fail-with-body rather than --fail, since the former will also print the API response message:
https://curl.se/docs/manpage.html#--fail-with-body

Copy link
Member

@edmorley edmorley Aug 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For even more bonus points, perhaps we should also add --connect-timeout and --retry to reduce flakiness?

-H "ACCEPT: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Token ${{ secrets.TPS_TOKEN }}" \
-d '{"lock": {"sha": "${{ github.sha }}", "component_name": "${{ vars.tps_component }}"}}' \
${{ secrets.TPS_CTC_API_URL }}
joshwlewis marked this conversation as resolved.
Show resolved Hide resolved

promote-tags:
if: github.ref_type == 'tag'
name: "Promote heroku-${{ matrix.stack-version }} tags"
needs:
- ctc-check
- publish-images
- publish-indices
runs-on: ubuntu-24.04
Expand Down