-
Notifications
You must be signed in to change notification settings - Fork 1
feat: adds support for release-related policies #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
chris-cmsoft
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for fetching and storing repository release information to enable release-related policy evaluations.
- Adds
LastReleasefield to theSaturatedRepositorystruct to store the latest release data - Implements
FecthLatestReleasefunction to fetch the latest release from GitHub API with proper 404 handling - Adds debug logging for evidence marshaling to aid in troubleshooting
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| owner := repo.GetOwner().GetLogin() | ||
| name := repo.GetName() | ||
|
|
||
| release, resp, err := l.githubClient.Repositories.GetLatestRelease(ctx, owner, name) |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function naming is inconsistent with similar functions in this file. Other similar functions use the "Gather" prefix (e.g., GatherSBOM, GatherOpenPullRequests, GatherWorkflowRuns). Consider renaming to GatherLatestRelease for consistency.
| release, resp, err := l.githubClient.Repositories.GetLatestRelease(ctx, owner, name) | |
| func (l *GithubReposPlugin) GatherLatestRelease(ctx context.Context, repo *github.Repository) (*github.RepositoryRelease, error) { |
| owner := repo.GetOwner().GetLogin() | ||
| name := repo.GetName() | ||
|
|
||
| release, resp, err := l.githubClient.Repositories.GetLatestRelease(ctx, owner, name) |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in function name: 'Fecth' should be 'Fetch'.
| release, resp, err := l.githubClient.Repositories.GetLatestRelease(ctx, owner, name) | |
| func (l *GithubReposPlugin) FetchLatestRelease(ctx context.Context, repo *github.Repository) (*github.RepositoryRelease, error) { |
| }, err | ||
| } | ||
|
|
||
| release, err := l.FecthLatestRelease(ctx, repo) |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in function name: 'Fecth' should be 'Fetch'.
| release, err := l.FecthLatestRelease(ctx, repo) | |
| release, err := l.FetchLatestRelease(ctx, repo) |
No description provided.