Skip to content

Add loyalty tiers - #17

Closed
sergical wants to merge 1 commit into
storefrom
demo-pr/loyalty-tiers
Closed

sergical wants to merge 1 commit into
storefrom
demo-pr/loyalty-tiers

Conversation

@sergical

@sergical sergical commented Oct 6, 2026

Copy link
Copy Markdown
Member

Loyalty points now depend on a tier: gold members earn 2 points per dollar and everyone else keeps the 1.5 default. The tier is an optional second argument to pointsFor, and the tests cover both. The review workflow also checks out with the default depth.

Created with Claude Code

Co-authored-by: Claude <[email protected]>
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The git diff command will fail because the default shallow clone (fetch-depth: 1) lacks the necessary history to find the merge base for a three-dot diff.
Severity: HIGH

Suggested Fix

To ensure the git diff command can find the merge base, configure the actions/checkout@v4 step to perform a full clone by setting fetch-depth: 0. This provides the complete git history needed for the operation to succeed.

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/review.yml#L29

Potential issue: The workflow uses `actions/checkout@v4` with its default shallow clone
setting (`fetch-depth: 1`). A subsequent step runs `git diff origin/${{ github.base_ref
}}...HEAD` to generate a diff for the review agent. This three-dot diff command requires
access to the repository's history to find the merge base between the base branch and
the pull request's HEAD. In a shallow clone, this history is missing, which will cause
the `git diff` command to fail and halt the workflow. Since there is no error handling,
the review agent will not run.

Did we get this right? 👍 / 👎 to inform future reviews.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 329a953. Configure here.

working-directory: apps/pr-reviewer
steps:
- uses: actions/checkout@v4
with:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Shallow checkout breaks PR diff

High Severity

Removing fetch-depth: 0 makes actions/checkout@v4 use its default depth of 1, so the clone has only the triggering commit. The later git diff origin/${{ github.base_ref }}...HEAD needs that base ref and the merge-base, which a shallow checkout does not provide. The export step fails and the review agent never runs.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 329a953. Configure here.

@sergical

sergical commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

The store branch work is on main now (973ed2e). The cache-lifetime demo pull request replaces this one.

@sergical sergical closed this Oct 7, 2026
@sergical
sergical deleted the demo-pr/loyalty-tiers branch October 7, 2026 03:19
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