Skip to content

Add GrantReplaced annotation for grant#174

Merged
MarcusGoldschmidt merged 2 commits into
mainfrom
goldschmidt/grant-replace-annotation
Jun 12, 2026
Merged

Add GrantReplaced annotation for grant#174
MarcusGoldschmidt merged 2 commits into
mainfrom
goldschmidt/grant-replace-annotation

Conversation

@MarcusGoldschmidt

Copy link
Copy Markdown
Contributor

No description provided.

@MarcusGoldschmidt MarcusGoldschmidt requested a review from a team June 11, 2026 19:54
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Connector PR Review: Add GrantReplaced annotation for grant

Blocking Issues: 0 | Suggestions: 1 | Threads Resolved: 0
Review mode: incremental since 9ef5db4
View review run

Review Summary

The new commits extract the "read" string literal into a readConst constant and replace three occurrences across roleNameToRepoPermission, getOrgBasePermission, and orgBasePermissionToRepoPermissions. The core GrantReplaced annotation logic from the prior commits is unchanged and looks correct—collaborator check, permission-level lookup, idempotent GrantAlreadyExists handling, and replaced-grant ID construction all follow SDK conventions. One minor naming suggestion on the new constant.

Security Issues

None found.

Correctness Issues

None found.

Suggestions

  • readConst naming in pkg/connector/repository.go:34 — name encodes Go type rather than domain concept; consider apiRoleRead for clarity.
Prompt for AI agents
Verify each finding against the current code and only fix it if needed.

## Suggestions

In `pkg/connector/repository.go`:
- Around line 34: Rename `readConst` to something like `apiRoleRead` or `roleNameRead` to
  distinguish the GitHub API role vocabulary ("read"/"write") from the entitlement permission
  vocabulary ("pull"/"push"). Update all references (lines 51, 82, 85) accordingly.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No blocking issues found.

repoPermissionAdmin = "admin"
)

const readConst = "read"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Suggestion: readConst encodes the Go type in the name rather than describing the domain concept. The other constants in this file use the repoPermission* prefix. Consider a name like apiRoleRead or roleNameRead to clarify this is the GitHub API's role vocabulary (as opposed to the entitlement permission vocabulary).

Suggested change
const readConst = "read"
const apiRoleRead = "read"

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No blocking issues found.

@MarcusGoldschmidt MarcusGoldschmidt merged commit 07ba55b into main Jun 12, 2026
9 checks passed
@MarcusGoldschmidt MarcusGoldschmidt deleted the goldschmidt/grant-replace-annotation branch June 12, 2026 18:44
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