Skip to content
Open
Show file tree
Hide file tree
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
28 changes: 15 additions & 13 deletions .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ statusProvider:
name: github
config:
contexts:
- 'build-multiplatform-image-ghcr-amd64'
- 'build-multiplatform-image-ghcr-arm64'
- 'Create multi-platform manifest'
- 'build-multiplatform-image-ghcr-amd64'
- 'build-multiplatform-image-ghcr-arm64'
- 'Create multi-platform manifest'

targets:
- name: github
- id: release
name: docker
source: ghcr.io/getsentry/uptime-checker
target: getsentry/uptime-checker
- id: latest
name: docker
source: ghcr.io/getsentry/uptime-checker
target: getsentry/uptime-checker
targetFormat: '{{{target}}}:latest'
- name: github
- id: release
name: docker
source: ghcr.io/getsentry/uptime-checker
target: getsentry/uptime-checker
- id: latest
name: docker
source: ghcr.io/getsentry/uptime-checker
target: getsentry/uptime-checker
targetFormat: '{{{target}}}:latest'
versioning:
policy: calver
17 changes: 17 additions & 0 deletions .github/workflows/changelog-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Changelog Preview
on:
pull_request:
types:
- opened
- synchronize
- reopened
- edited
- labeled
permissions:
contents: write
pull-requests: write

jobs:
changelog-preview:
uses: getsentry/craft/.github/workflows/changelog-preview.yml@v2
secrets: inherit
54 changes: 23 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,38 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: Version to release (optional)
description: Version to release (or "auto")
required: false
force:
description: Force a release even when there are release-blockers (optional)
description: Force a release even when there are release-blockers
required: false

schedule:
# We want the release to be at 9-10am Pacific Time
# We also want it to be 1 hour before the self-hosted release
- cron: "0 17 15 * *"

- cron: "0 17 15 * *"
permissions:
contents: write # required to create a release
contents: write
pull-requests: write

jobs:
release:
runs-on: ubuntu-latest
name: Release a new ${{ github.repository }} version

name: Release a new version
steps:
- name: Get auth token
id: token
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
with:
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
token: ${{ steps.token.outputs.token }}
fetch-depth: 0

- name: Prepare release
uses: getsentry/action-prepare-release@3cea80dc3938c0baf5ec4ce752ecb311f8780cdc # v1
env:
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
with:
version: ${{ github.event.inputs.version }}
force: ${{ github.event.inputs.force }}
calver: true
- name: Get auth token
id: token
uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v2
with:
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v3 # v2
with:
token: ${{ steps.token.outputs.token }}
fetch-depth: 0
- name: Prepare release
uses: getsentry/craft@39ee616a6a58dc64797feecb145d66770492b66c # v2
env:
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
with:
version: ${{ inputs.version }}
force: ${{ inputs.force }}
Copy link

Choose a reason for hiding this comment

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

Bug: During scheduled runs, ${{ inputs.version }} will be empty, which may cause the craft action to fail as it might not accept an empty version string.
Severity: CRITICAL

🔍 Detailed Analysis

The release.yml workflow is triggered on a schedule and by workflow_dispatch. For scheduled runs, the inputs context is empty. Consequently, the version and force parameters passed to the craft action will be empty strings. While the PR adds a versioning: policy: calver configuration, which might be intended to handle this, there is a risk that the craft action does not interpret an empty string as a request for auto-versioning and will instead fail, as it's documented to reject empty version inputs. This would cause all scheduled releases to fail.

💡 Suggested Fix

Provide a default value for the version and force inputs to handle scheduled runs where the inputs context is empty. For example: version: ${{ inputs.version || 'auto' }} and force: ${{ inputs.force || false }}.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: .github/workflows/release.yml#L37-L38

Potential issue: The `release.yml` workflow is triggered on a schedule and by
`workflow_dispatch`. For scheduled runs, the `inputs` context is empty. Consequently,
the `version` and `force` parameters passed to the `craft` action will be empty strings.
While the PR adds a `versioning: policy: calver` configuration, which might be intended
to handle this, there is a risk that the `craft` action does not interpret an empty
string as a request for auto-versioning and will instead fail, as it's documented to
reject empty `version` inputs. This would cause all scheduled releases to fail.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 8427358

Copy link

Choose a reason for hiding this comment

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

Bug: On scheduled runs, inputs.version and inputs.force will be empty strings, which may cause the getsentry/craft action to fail if it doesn't handle empty inputs.
Severity: HIGH

🔍 Detailed Analysis

The GitHub workflow is configured to run on a schedule. During a scheduled run, the inputs context is empty, causing ${{ inputs.version }} and ${{ inputs.force }} to be passed as empty strings to the getsentry/craft@v2 action. If this action does not gracefully handle empty string values for these parameters, the scheduled release process will fail. While it is plausible the action is designed to handle this, as its author wrote this workflow, the behavior is unconfirmed and could lead to a failure in the automated release pipeline.

💡 Suggested Fix

To ensure the workflow is robust, add a fallback value for the version parameter. For example, use ${{ inputs.version || 'auto' }} to explicitly use the 'auto' versioning feature during scheduled runs, assuming this is the intended default behavior for the Craft action.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: .github/workflows/release.yml#L37-L38

Potential issue: The GitHub workflow is configured to run on a schedule. During a
scheduled run, the `inputs` context is empty, causing `${{ inputs.version }}` and `${{
inputs.force }}` to be passed as empty strings to the `getsentry/craft@v2` action. If
this action does not gracefully handle empty string values for these parameters, the
scheduled release process will fail. While it is plausible the action is designed to
handle this, as its author wrote this workflow, the behavior is unconfirmed and could
lead to a failure in the automated release pipeline.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 8473281

Loading