Skip to content

Add Honeycomb release markers to classic buildpack publish#369

Open
colincasey wants to merge 3 commits into
mainfrom
honeycomb-release-markers
Open

Add Honeycomb release markers to classic buildpack publish#369
colincasey wants to merge 3 commits into
mainfrom
honeycomb-release-markers

Conversation

@colincasey

Copy link
Copy Markdown
Contributor

Adds an optional honeycomb_api_key secret to the classic buildpack publish workflow. When a caller passes it, a best-effort, idempotent marker is posted to the Honeycomb builds dataset on a successful production publish.

What

  • New optional honeycomb_api_key secret on _classic-buildpack-publish.yml's workflow_call interface.
  • A new Post Honeycomb release marker step appended after Create GitHub Release.

Behavior

  • Opt-in / no-op: skipped entirely when the secret isn't passed, so other language teams are unaffected.
  • Production-only: gated on env.MODE == 'production' — QA/staging publishes don't post markers.
  • Idempotent (create-or-update): dedups on the release URL, so re-running an idempotent publish updates the existing marker instead of stacking duplicates — matching the rest of this workflow.
  • Best-effort: every API call ends in || echo "::warning::..." and never exits non-zero; a Honeycomb outage can't fail an already-successful publish.

The dataset slug builds is hardcoded (shared by all classic buildpacks, gated by the API key, not sensitive). Only the API key is a secret.

W-22846373

@colincasey colincasey self-assigned this Jun 4, 2026
@colincasey colincasey marked this pull request as ready for review June 4, 2026 20:00
@colincasey colincasey requested a review from a team as a code owner June 4, 2026 20:00

@edmorley edmorley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry missed these on the first pass, only realised when looking at the similar heroku/cnb-builder-images#989

existing=$(curl -sS --retry 3 --retry-all-errors --max-time 30 "${auth[@]}" "${api}" \
| jq -r --arg url "$url" 'map(select(.url == $url)) | first | .id // empty' 2>/dev/null) || existing=""

if [[ -n "$existing" ]]; then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we want to be updating the entry if an existing one exists? It feels like we can/should just skip in that case?

In which case this also means the implementation here can be written with much less duplication.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d910c1f

>/dev/null && echo "Updated existing release marker (${existing})" \
|| echo "::warning::Failed to update Honeycomb release marker (publish succeeded regardless)"
else
curl -sS --retry 3 --retry-all-errors --max-time 30 -X POST "${api}" "${auth[@]}" -d "${body}" \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you add the missing standard curl best practices like --fail and --connect-timeout? (Without --fail, we won't get the annotation when the API returns a non-200 value etc)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d910c1f

# publish updates the existing marker rather than stacking a duplicate line on the board.
# Every path below warns on failure and never exits non-zero — a Honeycomb outage must
# not fail an already-successful publish.
existing=$(curl -sS --retry 3 --retry-all-errors --max-time 30 "${auth[@]}" "${api}" \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think we should pipe errors to /dev/null - let them be printed as is (only the stdout gets captured by the $() so the stderr is fine to still print, since it will be shown directly in the logs)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d910c1f

@colincasey colincasey force-pushed the honeycomb-release-markers branch from d910c1f to 0e8582b Compare June 11, 2026 18:37
@colincasey colincasey requested a review from edmorley June 11, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants