Skip to content
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

⚠️ Only trigger discovery tasks if the Application has a repository specified #715

Merged
merged 3 commits into from
Jul 11, 2024

Conversation

mansam
Copy link
Collaborator

@mansam mansam commented Jul 9, 2024

No description provided.

Signed-off-by: Sam Lucidi <slucidi@redhat.com>
Signed-off-by: Sam Lucidi <slucidi@redhat.com>
@mansam mansam requested a review from jortel July 9, 2024 17:38
if err != nil {
_ = ctx.Error(err)
return
if r.Repository != nil {
Copy link
Contributor

@jortel jortel Jul 9, 2024

Choose a reason for hiding this comment

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

How about moving the check for the repository into the trigger.Application? When the repository is nil, the trigger could no-op.
By encapsulating/delegating the check to the trigger it can be done in one place and shared by multiple callers. Further, the caller does not need to be concerned.

@mansam mansam force-pushed the discovery-require-repository branch from e2f8d79 to a6a3aec Compare July 10, 2024 15:00
@@ -23,14 +25,25 @@ func (r *Application) Updated(m *model.Application) (err error) {
if !Settings.Discovery.Enabled {
return
}

repo := model.Repository{}
err = json.Unmarshal(m.Repository, &repo)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This will be revisited when the JSON serialization work goes in.

Copy link
Contributor

@jortel jortel left a 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: Sam Lucidi <slucidi@redhat.com>
@mansam mansam force-pushed the discovery-require-repository branch from a6a3aec to 81b6daf Compare July 10, 2024 19:00
Copy link
Member

@aufi aufi left a comment

Choose a reason for hiding this comment

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

LGTM, got this error when tested 0.5.0-beta.1.

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