Skip to content

Conversation

@gberenice
Copy link
Member

@gberenice gberenice commented Jul 1, 2025

what

  • Auto-approve PRs: Added approval step using MASTERPOINT_TEAM_PAT (masterpoint-team) before merge
  • Updated CODEOWNERS: Added @masterpointio/masterpoint-team as code owners

why

  • Trunk upgrade workflow was failing with "At least 1 approving review is required" error due to Repository Rules enforcement.

references

Summary by CodeRabbit

  • Chores
    • Updated repository code owners to include an additional team.
    • Modified workflow to use a different token and added an explicit auto-approval step before merging pull requests.

@gberenice gberenice requested a review from a team as a code owner July 1, 2025 15:09
@gberenice gberenice requested a review from Gowiem July 1, 2025 15:09
@gberenice gberenice merged commit da097cc into main Jul 1, 2025
5 checks passed
@gberenice gberenice deleted the fix/auto-approve branch July 1, 2025 15:10
@coderabbitai
Copy link

coderabbitai bot commented Jul 1, 2025

Walkthrough

This change updates repository metadata and workflow automation. In the .github/CODEOWNERS file, an additional team (@masterpoint-team) is added as a default code owner alongside the existing team. In the .github/workflows/trunk-upgrade.yaml workflow, the GitHub token used for merging PRs is switched from a generated app token to a stored secret, and an explicit PR approval step is introduced before merging, using the GitHub CLI. No changes are made to exported or public entities.

Possibly related PRs

Suggested reviewers

  • oycyc
  • Gowiem
✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment
  • Commit Unit Tests in branch fix/auto-approve

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
.github/workflows/trunk-upgrade.yaml (1)

44-67: Infinite loop risk – add an upper bound or use gh pr checks --watch

while true polls every 30 s with no escape hatch. If a required check is stuck in the “pending” state the job will run until the 6-hour GitHub Actions hard timeout, wasting CI minutes.

Suggested minimal safety net:

-while true; do
+MAX_ATTEMPTS=120   # 1 hour at 30 s intervals
+ATTEMPT=0
+while [ "$ATTEMPT" -lt "$MAX_ATTEMPTS" ]; do
   ...
-  else
-    echo "Some required checks are still running or pending. Retrying in 30s..."
-    sleep 30
-  fi
+  else
+    echo "Some required checks are still running or pending. Retrying in 30 s..."
+    sleep 30
+    ATTEMPT=$((ATTEMPT + 1))
+  fi
 done
+
+echo "Timeout waiting for status checks (> $((MAX_ATTEMPTS*30/60)) min)."
+exit 1

Alternatively, replace the whole loop with:

gh pr checks "$PR_NUMBER" --watch --required

which blocks until all required checks succeed or fail and exits appropriately.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 57f59b8 and 2355f46.

📒 Files selected for processing (2)
  • .github/CODEOWNERS (1 hunks)
  • .github/workflows/trunk-upgrade.yaml (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: Gowiem
PR: masterpointio/terraform-spacelift-automation#19
File: .github/workflows/renovate.json5:7-7
Timestamp: 2024-12-22T19:36:59.636Z
Learning: Some of Gowiem's repositories still use 'master' as the primary branch, so they intentionally keep "master" in Renovate's baseBranches for a shared configuration.
🔇 Additional comments (1)
.github/workflows/trunk-upgrade.yaml (1)

40-42: Double-check secret & scopes for MASTERPOINT_TEAM_PAT

gh will perform both a review and a merge. The token therefore needs repo → pull_request:write + contents:write scopes (and ideally nothing more).
Please verify that the secret exists at the org level and has the minimal scopes required; otherwise this step will still fail even though the workflow now passes status checks.


# These owners will be the default owners for everything
* @masterpointio/masterpoint-open-source
* @masterpointio/masterpoint-open-source @masterpoint-team
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Invalid team slug – missing organization prefix

@masterpoint-team lacks the @org/ prefix required by GitHub CODEOWNERS. As-is, ownership resolution will silently fail and PRs will still demand a manual review.

-*             @masterpointio/masterpoint-open-source @masterpoint-team
+*             @masterpointio/masterpoint-open-source @masterpointio/masterpoint-team
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* @masterpointio/masterpoint-open-source @masterpoint-team
* @masterpointio/masterpoint-open-source @masterpointio/masterpoint-team
🤖 Prompt for AI Agents
In the .github/CODEOWNERS file at line 7, the team slug '@masterpoint-team' is
missing the required organization prefix. Update '@masterpoint-team' to include
the organization prefix, changing it to '@masterpointio/masterpoint-team' to
ensure proper ownership resolution by GitHub.

gberenice pushed a commit that referenced this pull request Jul 1, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.8.1](v0.8.0...v0.8.1)
(2025-07-01)


### Bug Fixes

* add cursor to ignored ai code gen
([#46](#46))
([57f59b8](57f59b8))
* **gha:** add auto-approve + update codeowners
([#49](#49))
([da097cc](da097cc))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: masterpointbot[bot] <177651640+masterpointbot[bot]@users.noreply.github.com>
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.

3 participants