assisted-service icon indicating copy to clipboard operation
assisted-service copied to clipboard

WIP: MGMT-17751: Break the dependency of /models module in / module

Open danmanor opened this issue 1 year ago • 7 comments

Currently, assisted-service project is composed of 4 Go modules:

  • /
  • /models
  • /api
  • /client

The relationship between the modules is as follows:

  • All modules depend on /models
  • / depend on all other modules
  • /models depend on / (because it imports one function from /pkg/validations)

There are other projects (assisted-installer, assisted-installer-agent for example) the import assisted-service's sub modules, therefore indirectly importing / module for no good reason. This issue has many cons including CVE issues for /module opened for assisted-image-service and assisted-installer-agent as well.

To mitigate this issue, we should move the function used in /pkg/validations to /models module

List all the issues related to this PR

  • [ ] New Feature
  • [x] Enhancement
  • [ ] Bug fix
  • [ ] Tests
  • [ ] Documentation
  • [ ] CI/CD

What environments does this code impact?

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

How was this code tested?

  • [ ] assisted-test-infra environment
  • [ ] dev-scripts environment
  • [ ] Reviewer's test appreciated
  • [x] Waiting for CI to do a full test run
  • [ ] Manual (Elaborate on how it was tested)
  • [ ] No tests needed

Checklist

  • [x] Title and description added to both, commit and PR.
  • [x] Relevant issues have been associated (see CONTRIBUTING guide)
  • [x] 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?

danmanor avatar May 08 '24 08:05 danmanor

@danmanor: This pull request references MGMT-17751 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 task to target the "4.16.0" version, but no target version was set.

In response to this:

Currently, assisted-service project is composed of 4 Go modules:

  • /
  • /models
  • /api
  • /client

The relationship between the modules is as follows:

  • All modules depend on /models
  • / depend on all other modules
  • /models depend on / (because it imports one function from /pkg/validations)

There are other projects (assisted-installer, assisted-installer-agent for example) the import assisted-service's sub modules, therefore indirectly importing / module for no good reason. This issue has many cons including CVE issues for /module opened for assisted-image-service and assisted-installer-agent as well.

To mitigate this issue, we should move the function used in /pkg/validations to /models module

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
  • [x] 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)
  • [x] 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-robot avatar May 08 '24 08:05 openshift-ci-robot

@danmanor: This pull request references MGMT-17751 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 task to target the "4.16.0" version, but no target version was set.

In response to this:

Currently, assisted-service project is composed of 4 Go modules:

  • /
  • /models
  • /api
  • /client

The relationship between the modules is as follows:

  • All modules depend on /models
  • / depend on all other modules
  • /models depend on / (because it imports one function from /pkg/validations)

There are other projects (assisted-installer, assisted-installer-agent for example) the import assisted-service's sub modules, therefore indirectly importing / module for no good reason. This issue has many cons including CVE issues for /module opened for assisted-image-service and assisted-installer-agent as well.

To mitigate this issue, we should move the function used in /pkg/validations to /models module

List all the issues related to this PR

  • [ ] New Feature
  • [x] Enhancement
  • [ ] Bug fix
  • [ ] Tests
  • [ ] Documentation
  • [ ] CI/CD

What environments does this code impact?

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

How was this code tested?

  • [ ] assisted-test-infra environment
  • [ ] dev-scripts environment
  • [ ] Reviewer's test appreciated
  • [x] Waiting for CI to do a full test run
  • [ ] Manual (Elaborate on how it was tested)
  • [ ] 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-robot avatar May 08 '24 08:05 openshift-ci-robot

@danmanor: This pull request references MGMT-17751 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 task to target the "4.16.0" version, but no target version was set.

In response to this:

Currently, assisted-service project is composed of 4 Go modules:

  • /
  • /models
  • /api
  • /client

The relationship between the modules is as follows:

  • All modules depend on /models
  • / depend on all other modules
  • /models depend on / (because it imports one function from /pkg/validations)

There are other projects (assisted-installer, assisted-installer-agent for example) the import assisted-service's sub modules, therefore indirectly importing / module for no good reason. This issue has many cons including CVE issues for /module opened for assisted-image-service and assisted-installer-agent as well.

To mitigate this issue, we should move the function used in /pkg/validations to /models module

List all the issues related to this PR

  • [ ] New Feature
  • [x] Enhancement
  • [ ] Bug fix
  • [ ] Tests
  • [ ] Documentation
  • [ ] CI/CD

What environments does this code impact?

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

How was this code tested?

  • [ ] assisted-test-infra environment
  • [ ] dev-scripts environment
  • [ ] Reviewer's test appreciated
  • [x] Waiting for CI to do a full test run
  • [ ] Manual (Elaborate on how it was tested)
  • [ ] 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-robot avatar May 08 '24 08:05 openshift-ci-robot

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danmanor

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:

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

openshift-ci[bot] avatar May 08 '24 08:05 openshift-ci[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 68.28%. Comparing base (9a4ece9) to head (989b764). Report is 133 commits behind head on master.

:exclamation: Current head 989b764 differs from pull request most recent head 7fa05bc

Please upload reports for the commit 7fa05bc to get more accurate results.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6287      +/-   ##
==========================================
- Coverage   68.29%   68.28%   -0.01%     
==========================================
  Files         241      241              
  Lines       35858    35836      -22     
==========================================
- Hits        24488    24470      -18     
+ Misses       9211     9209       -2     
+ Partials     2159     2157       -2     
Files Coverage Δ
internal/dns/dns.go 72.36% <100.00%> (ø)

... and 3 files with indirect coverage changes

codecov[bot] avatar May 08 '24 08:05 codecov[bot]

PR needs rebase.

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-sigs/prow repository.

openshift-merge-robot avatar Aug 05 '24 13:08 openshift-merge-robot

@danmanor: 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-subsystem-aws 7fa05bc19a0d4575a1f50824d4d9ac32886d18d0 link true /test edge-subsystem-aws
ci/prow/edge-subsystem-kubeapi-aws 7fa05bc19a0d4575a1f50824d4d9ac32886d18d0 link true /test edge-subsystem-kubeapi-aws
ci/prow/edge-verify-generated-code 7fa05bc19a0d4575a1f50824d4d9ac32886d18d0 link true /test edge-verify-generated-code
ci/prow/edge-unit-test 7fa05bc19a0d4575a1f50824d4d9ac32886d18d0 link true /test edge-unit-test
ci/prow/edge-e2e-metal-assisted-odf-4-16 7fa05bc19a0d4575a1f50824d4d9ac32886d18d0 link true /test edge-e2e-metal-assisted-odf-4-16
ci/prow/edge-e2e-metal-assisted-cnv-4-16 7fa05bc19a0d4575a1f50824d4d9ac32886d18d0 link true /test edge-e2e-metal-assisted-cnv-4-16
ci/prow/edge-e2e-metal-assisted-cnv-4-17 7fa05bc19a0d4575a1f50824d4d9ac32886d18d0 link true /test edge-e2e-metal-assisted-cnv-4-17
ci/prow/edge-e2e-metal-assisted-odf-4-17 7fa05bc19a0d4575a1f50824d4d9ac32886d18d0 link true /test edge-e2e-metal-assisted-odf-4-17
ci/prow/edge-e2e-metal-assisted-mtv-4-17 7fa05bc19a0d4575a1f50824d4d9ac32886d18d0 link true /test edge-e2e-metal-assisted-mtv-4-17

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-sigs/prow repository. I understand the commands that are listed here.

openshift-ci[bot] avatar Oct 28 '24 11:10 openshift-ci[bot]