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

MGMT-16002: Accept *yml.patch* and *yaml.patch* extensions #6070

Merged
merged 2 commits into from Mar 22, 2024

Conversation

paul-maidment
Copy link
Contributor

Presently we do not accept filenames containing yml.patch or yaml.patch
We should accept these files.
This PR rectifies that.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
    Performed curl requests against an assisted-test-infra based cluster that is running this service image. yml.patch and yaml.patch files were accepted as expected.
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 10, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 10, 2024

@paul-maidment: This pull request references MGMT-16002 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.16.0" version, but no target version was set.

In response to this:

Presently we do not accept filenames containing yml.patch or yaml.patch
We should accept these files.
This PR rectifies that.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
    Performed curl requests against an assisted-test-infra based cluster that is running this service image. yml.patch and yaml.patch files were accepted as expected.
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 10, 2024
@openshift-ci openshift-ci bot added api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 10, 2024
Copy link

codecov bot commented Mar 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.58%. Comparing base (2f7c5ca) to head (9546333).
Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6070      +/-   ##
==========================================
+ Coverage   68.36%   69.58%   +1.22%     
==========================================
  Files         239      240       +1     
  Lines       35529    37517    +1988     
==========================================
+ Hits        24291    26108    +1817     
- Misses       9131     9197      +66     
- Partials     2107     2212     +105     
Files Coverage Δ
internal/manifests/manifests.go 78.49% <100.00%> (+0.83%) ⬆️

... and 12 files with indirect coverage changes

@@ -92,17 +92,17 @@
"cpu_architectures": [
"x86_64"
],
"url": "quay.io/openshift-release-dev/ocp-release:4.13.35-x86_64",
"version": "4.13.35"
"url": "quay.io/openshift-release-dev/ocp-release:4.13.36-x86_64",
Copy link
Contributor

Choose a reason for hiding this comment

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

all changes in this file are not related to your PR - please remove it

deploy/podman/configmap.yml Outdated Show resolved Hide resolved
openshift/template.yaml Outdated Show resolved Hide resolved
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 15, 2024
@gamli75
Copy link
Contributor

gamli75 commented Mar 17, 2024

@adriengentil please review

@adriengentil
Copy link
Contributor

internal/manifests/manifests.go Show resolved Hide resolved
@@ -540,12 +540,12 @@ func (m *Manifests) validateUserSuppliedManifest(ctx context.Context, clusterID
if !json.Valid(manifestContent) {
return m.prepareAndLogError(ctx, http.StatusBadRequest, errors.Errorf("Manifest content of file %s for cluster ID %s has an illegal JSON format", fileName, string(clusterID)))
}
} else if strings.HasPrefix(extension, ".patch") && (strings.Contains(fileName, ".yaml.patch") || strings.Contains(fileName, ".yml.patch")) {
} else if strings.Contains(fileName, ".yaml.patch") || strings.Contains(fileName, ".yml.patch") {
if err := isValidYaml(manifestContent); 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.

shouldn't we validate that the file is a valid yaml patch instead? https://github.com/openshift/assisted-service/blob/master/internal/common/common.go#L482

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed!
I have changed this.

Presently we do not accept filenames containing yml.patch or yaml.patch
We should accept these files.
This PR rectifies that.
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 20, 2024
@gamli75
Copy link
Contributor

gamli75 commented Mar 20, 2024

/retest-required

Presently we do not accept filenames containing *yml.patch* or *yaml.patch*
We should accept these files.
This PR rectifies that.
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 21, 2024
Copy link

openshift-ci bot commented Mar 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adriengentil, paul-maidment

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 [adriengentil,paul-maidment]

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

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 2f7c5ca and 2 for PR HEAD 9546333 in total

@adriengentil
Copy link
Contributor

/retest

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 41ad865 and 1 for PR HEAD 9546333 in total

@adriengentil
Copy link
Contributor

/retest

Copy link

openshift-ci bot commented Mar 22, 2024

@paul-maidment: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/edge-e2e-ai-operator-disconnected-capi 9546333 link false /test edge-e2e-ai-operator-disconnected-capi
ci/prow/edge-e2e-ai-operator-ztp-capi 9546333 link false /test edge-e2e-ai-operator-ztp-capi

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 9ad7c61 into openshift:master Mar 22, 2024
14 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants