Skip to content

Conversation

@gusfcarvalho
Copy link
Contributor

No description provided.

Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Copy link

@chris-cmsoft chris-cmsoft left a comment

Choose a reason for hiding this comment

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

LGTM

gusfcarvalho and others added 2 commits December 9, 2025 09:33
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Copy link
Contributor

Copilot AI left a 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 LastRelease field to the SaturatedRepository struct to store the latest release data
  • Implements FecthLatestRelease function 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)
Copy link

Copilot AI Dec 9, 2025

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.

Suggested change
release, resp, err := l.githubClient.Repositories.GetLatestRelease(ctx, owner, name)
func (l *GithubReposPlugin) GatherLatestRelease(ctx context.Context, repo *github.Repository) (*github.RepositoryRelease, error) {

Copilot uses AI. Check for mistakes.
owner := repo.GetOwner().GetLogin()
name := repo.GetName()

release, resp, err := l.githubClient.Repositories.GetLatestRelease(ctx, owner, name)
Copy link

Copilot AI Dec 9, 2025

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'.

Suggested change
release, resp, err := l.githubClient.Repositories.GetLatestRelease(ctx, owner, name)
func (l *GithubReposPlugin) FetchLatestRelease(ctx context.Context, repo *github.Repository) (*github.RepositoryRelease, error) {

Copilot uses AI. Check for mistakes.
}, err
}

release, err := l.FecthLatestRelease(ctx, repo)
Copy link

Copilot AI Dec 9, 2025

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'.

Suggested change
release, err := l.FecthLatestRelease(ctx, repo)
release, err := l.FetchLatestRelease(ctx, repo)

Copilot uses AI. Check for mistakes.
@gusfcarvalho gusfcarvalho merged commit a7dbc60 into master Dec 9, 2025
2 checks passed
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