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

[KS-590] Auto-approval for workflow spec deletion #15414

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

bolekk
Copy link
Contributor

@bolekk bolekk commented Nov 25, 2024

No description provided.

Copy link
Contributor

I see you updated files related to core. Please run pnpm changeset in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

Copy link
Contributor

github-actions bot commented Nov 25, 2024

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@bolekk bolekk force-pushed the KS-590/workflow-deletion branch from 64d4820 to 5774807 Compare November 26, 2024 00:02
@@ -510,6 +510,21 @@ func (s *service) DeleteJob(ctx context.Context, args *DeleteJobArgs) (int64, er
logger.Errorw("Failed to push metrics for job proposal deletion", "err", err)
}

job, err := s.jobORM.FindJobByExternalJobID(ctx, proposal.ExternalJobID.UUID)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if err != nil {
if !errors.Is(err, sql.ErrNoRows) {

Copy link
Contributor

Choose a reason for hiding this comment

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

oh yeah just copy the blob that @giogam linked :D including the proposal.ExternalJobID.Valid check since that would return false when the job is not in approved status.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why should we treat the NoRows error in a special way? Why not just catch any error?

Copy link
Contributor

Choose a reason for hiding this comment

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

Typically it is the ORM's responsibility to hide the sql details by catching this error internally and returning nil instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess the only issue here is that the ORM isn't returning nil here. List will return empty arrays when no record is found but get will typically return no row errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm I'm confused - is my code going to work or not? If there's any error, I give up and don't delete. That should be fine if nothing is found. What else can go wrong?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I see it just logs it and doesn't return, and with the .valid check before that, it looks like it should be fine now

@bolekk bolekk force-pushed the KS-590/workflow-deletion branch from 5774807 to fed1eb9 Compare December 2, 2024 01:24
@bolekk
Copy link
Contributor Author

bolekk commented Dec 2, 2024

@eutopian , @giogam - I addressed your feedback, please review again.

@bolekk bolekk force-pushed the KS-590/workflow-deletion branch from fed1eb9 to 4f9e258 Compare December 2, 2024 02:05
@bolekk bolekk added this pull request to the merge queue Dec 2, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 2, 2024
@bolekk bolekk added this pull request to the merge queue Dec 2, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 2, 2024
@bolekk bolekk added this pull request to the merge queue Dec 2, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 2, 2024
@bolekk bolekk added this pull request to the merge queue Dec 2, 2024
Merged via the queue into develop with commit 86d5f99 Dec 2, 2024
158 of 160 checks passed
@bolekk bolekk deleted the KS-590/workflow-deletion branch December 2, 2024 18:52
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.

4 participants