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

reordering submit flow to create test results as first action #1151

Merged

Conversation

acornett21
Copy link
Contributor

@acornett21 acornett21 commented Apr 29, 2024

  • Reordering submit flow to create test results early, then update them in the case where we have successfully created an image to link to the results.
  • We need not worry about re-try, or re-run (of preflight like in other API calls) or any of the other things we worry about for other pyxis routes, since pyxis/connect will just ignore (not show?) any results not linked to any images.
  • createTestResults was modified to account for both PATCH/POST, since there would be less duplicate code, if others are happier with two distinct methods, I'm happy to refactor that way as well.
  • JIRA: EET-3965

@openshift-ci openshift-ci bot requested a review from skattoju April 29, 2024 20:33
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 29, 2024
@dcibot
Copy link

dcibot commented Apr 29, 2024

@acornett21
Copy link
Contributor Author

/test 4.12-e2e

internal/pyxis/pyxis.go Outdated Show resolved Hide resolved
Comment on lines 19 to 30
// Create the test results, so we can fail fast if version check throws error.
testResults := certInput.TestResults
testResults, err = p.createOrUpdateTestResults(ctx, testResults, http.MethodPost)
if err != nil {
return nil, fmt.Errorf("could not create test results: %v", err)
}

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand this is here to fail fast, but it would seem that if there are other failures (e.g. if certImage.Repositories == 0 a few lines down), wouldn't we have created a TestResult for this account before we've asserted whether their content is valid?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, that should probably be first, since it was lost in the comments, I'll move it to be first thing.

@dcibot
Copy link

dcibot commented Apr 29, 2024

@dcibot
Copy link

dcibot commented Apr 29, 2024

Copy link

@Allda Allda left a comment

Choose a reason for hiding this comment

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

The new logic looks good to me.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 30, 2024
Copy link
Contributor

@komish komish left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Contributor

@bcrochet bcrochet left a comment

Choose a reason for hiding this comment

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

Question about the methods.

internal/pyxis/pyxis.go Outdated Show resolved Hide resolved
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label May 1, 2024
…inking to an imageID later in the flow to be able to fail fast and and not have incomplete results attached to an image

Signed-off-by: Adam D. Cornett <adc@redhat.com>
@dcibot
Copy link

dcibot commented May 2, 2024

Copy link
Contributor

@komish komish left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 2, 2024
Copy link
Contributor

@bcrochet bcrochet left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link

openshift-ci bot commented May 6, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: acornett21, Allda, bcrochet, komish

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [acornett21,bcrochet,komish]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@bcrochet bcrochet merged commit 375ed07 into redhat-openshift-ecosystem:main May 6, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants