Skip to content

Fix sentry recipe when release_path no longer exists - #4266

Open
mrhackcz wants to merge 1 commit into
deployphp:masterfrom
mrhackcz:fix/sentry-release-path
Open

mrhackcz wants to merge 1 commit into
deployphp:masterfrom
mrhackcz:fix/sentry-release-path

Conversation

@mrhackcz

Copy link
Copy Markdown
Contributor

Running dep deploy:sentry standalone fails with:

The "release_path" (/var/www/app/release) does not exist.

because the recipe reads the revision and git log from {{release_path}}, which is removed by deploy:symlink.

Changes in contrib/sentry.php:

  • Use {{release_or_current_path}} instead of {{release_path}} for reading the current revision and running git commands.
  • When previous_release is not set (standalone run), resolve the previous release from releases_list, so only new commits are sent instead of the whole history.
  • Limit commits via git rev-list --max-count=200. The previous array_slice(..., 0, 200) was applied before filtering out the commit <sha> header lines, so only 100 commits were sent for the first release.

Tested locally (localhost() host, archive strategy, fake Sentry API capturing the payload):

Scenario after('deploy', 'deploy:sentry') standalone dep deploy:sentry
first release (250 commits in repo) 200 commits 200 commits
second release (+3 commits) 3 commits 3 commits

Before the fix the standalone run failed with the release_path exception. php bin/docgen produces no changes; phpstan, php-cs-fixer and phpunit pass.

🤖 Generated with Claude Code

Running `dep deploy:sentry` standalone (or after `deploy:symlink`) failed
with `The "release_path" does not exist`, because the recipe read the
revision and git log from {{release_path}}.

- Use {{release_or_current_path}} for revision and git commands.
- Resolve the previous release from `releases_list` when
  `previous_release` is not set (standalone run).
- Limit commits with `git rev-list --max-count=200`; the previous
  array_slice counted the `commit <sha>` header lines too, so only
  100 commits were sent for the first release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant