Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

⚡ Updated build run syncstatus#302

Merged
abdheshnayak merged 1 commit into
mainfrom
feature/build-trigger
Mar 17, 2024
Merged

⚡ Updated build run syncstatus#302
abdheshnayak merged 1 commit into
mainfrom
feature/build-trigger

Conversation

@abdheshnayak
Copy link
Copy Markdown
Contributor

  • updated syncstatus for buildrun [ needs to test ]
  • added option for build trigger

@abdheshnayak abdheshnayak merged commit 9e7576d into main Mar 17, 2024
@abdheshnayak abdheshnayak deleted the feature/build-trigger branch March 17, 2024 06:12
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey @abdheshnayak - I've reviewed your changes and they look great!

General suggestions:

  • Ensure new parameters introduced in methods are fully utilized and documented to avoid confusion.
  • Review the security implications of the newly added 'seed' parameter in the context of generating unique keys.
  • Consider providing more explicit error handling for parsing operations to enhance debugging capabilities.
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟡 Security: 1 issue found
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Docstrings: all looks good

Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨

Share Sourcery

Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

Comment on lines +55 to +67
func (d *Impl) parseRecordVersionFromAnnotations(annotations map[string]string) (int, error) {
annotatedVersion, ok := annotations[constants.RecordVersionKey]
if !ok {
return 0, errors.Newf("no annotation with record version key (%s), found on the resource", constants.RecordVersionKey)
}

annVersion, err := strconv.ParseInt(annotatedVersion, 10, 32)
if err != nil {
return 0, errors.NewE(err)
}

return int(annVersion), nil
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion (code_refinement): Consider handling potential strconv.ParseInt errors more explicitly.

While the error from strconv.ParseInt is wrapped using errors.NewE, providing a more specific error message could help in debugging issues related to parsing the annotated version.

}

return int(annVersion), nil
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

question (code_clarification): Ensure proper handling of the new 'status' parameter.

The 'status' parameter introduced in OnBuildRunUpdateMessage does not seem to be used within the function. If it's intended for future use, consider documenting its purpose or implementing its usage if applicable.

}

return int(annVersion), nil
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚨 question (security): Validate the 'seed' parameter usage in CreateBuildRun.

The addition of the 'seed' parameter in CreateBuildRun is interesting. Ensure that its usage in generating a unique key is secure and meets the intended purpose, especially in the context of potential replay or collision attacks.

abdheshnayak added a commit that referenced this pull request Nov 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant