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

Removing support for github based registries #5708

Merged

Conversation

mohammedzee1000
Copy link
Contributor

@mohammedzee1000 mohammedzee1000 commented May 2, 2022

Signed-off-by: Mohammed Zeeshan Ahmed mohammed.zee1000@gmail.com

What type of PR is this:

/kind task

What does this PR do / why we need it:

Which issue(s) this PR fixes:

Fixes #5579

PR acceptance criteria:

  • Unit test

  • Integration test

  • Documentation

How to test changes / Special notes to the reviewer:
You should no longer be able to add, update, list GitHub based registries
odo preference registry add should not allow github registry urls
list should not show github registries
update should not allow github registries

./odo preference registry list  
NAME                       URL                                           SECURE
CheRegistry                https://che-devfile-registry.openshift.io     No
DefaultDevfileRegistry     https://registry.devfile.io                   No
./odo preference registry add test https://github.com/elsony/devfile-registry
 ✗  github based registries are no longer supported, use https://github.com/devfile/registry-support instead
 ./odo preference registry update CheRegistry https://github.com/elsony/devfile-registry
 ✗  github based registries are no longer supported, use https://github.com/devfile/registry-support instead

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. kind/task Issue is actionable task labels May 2, 2022
@netlify
Copy link

netlify bot commented May 2, 2022

Deploy Preview for odo-docusaurus-preview canceled.

Name Link
🔨 Latest commit a8f7f66
🔍 Latest deploy log https://app.netlify.com/sites/odo-docusaurus-preview/deploys/6274ef4a5026690008724a85

@openshift-ci openshift-ci bot requested review from rm3l and valaparthvi May 2, 2022 07:59
@odo-robot
Copy link

odo-robot bot commented May 2, 2022

Unit Tests on commit 00773fb finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented May 2, 2022

Windows Tests (OCP) on commit 00773fb finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented May 2, 2022

Kubernetes Tests on commit 00773fb finished with errors.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented May 2, 2022

OpenShift Tests on commit 00773fb finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented May 2, 2022

Validate Tests on commit 00773fb finished successfully.
View logs: TXT HTML

@mohammedzee1000 mohammedzee1000 changed the title WIP Removing support for github based registries Removing support for github based registries May 2, 2022
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. label May 2, 2022
@mohammedzee1000 mohammedzee1000 changed the title Removing support for github based registries WIP Removing support for github based registries May 2, 2022
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. label May 2, 2022
@mohammedzee1000 mohammedzee1000 changed the title WIP Removing support for github based registries Removing support for github based registries May 2, 2022
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. label May 2, 2022
@mohammedzee1000
Copy link
Contributor Author

mohammedzee1000 commented May 2, 2022

/test unit
could not find golang-lint

@mohammedzee1000
Copy link
Contributor Author

/test v4.10-integration-e2e
infra issue

}

const indexPath = "/devfiles/index.json"
// const indexPath = "/devfiles/index.json" :Not sure if this should be removed but it is not used for now
Copy link
Contributor

Choose a reason for hiding this comment

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

If this iss not used, let's remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok


// getRegistryStacks retrieves the registry's index devfile stack entries
func getRegistryStacks(preferenceClient preference.Client, registry Registry) ([]DevfileStack, error) {
if !strings.Contains(registry.URL, "github") {
if !registryUtil.IsGithubBasedRegistry(registry.URL) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please do the other way as usual:

if registryUtil.IsGithubBasedRegistry(registry.URL) {
  return nil, registryUtil.ErrGithubRegistryNotSupported
} 
// OCI-based registry
...

It("should not show deprecation warning if git registry is not used for component creation", func() {
out, err = helper.Cmd("odo", "init", "--name", "aname", "--devfile", "nodejs", "--devfile-registry", "DefaultDevfileRegistry").ShouldPass().OutAndErr()
helper.DontMatchAllInOutput(fmt.Sprintln(out, err), []string{deprecated, docLink})
It("should fail with error", func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

You have two When's without any BeforeEach, you can remove both of them and have only one It("should fail adding a git based registry", ...

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label May 4, 2022
pkg/odo/cli/preference/registry/util/util.go Outdated Show resolved Hide resolved
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. Required by Prow. label May 5, 2022
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
pkg/init/backend/flags.go Show resolved Hide resolved
pkg/odo/cli/preference/registry/util/util.go Outdated Show resolved Hide resolved
mohammedzee1000 and others added 2 commits May 6, 2022 15:12
Co-authored-by: Armel Soro <armel@rm3l.org>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
@sonarcloud
Copy link

sonarcloud bot commented May 6, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@mohammedzee1000 mohammedzee1000 requested a review from rm3l May 6, 2022 12:32
Copy link
Member

@rm3l rm3l left a comment

Choose a reason for hiding this comment

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

LGTM - thanks.

I can see a test not passing on IBM Cloud, but that does not seem related to the changes in this PR:

• Failure [380.063 seconds]
odo dev command tests
/workspace/c1645ecf-e7f2-4095-8aff-fbec607d1fa1/tests/integration/devfile/cmd_dev_test.go:25
  when a component is bootstrapped and pushed
  /workspace/c1645ecf-e7f2-4095-8aff-fbec607d1fa1/tests/integration/devfile/cmd_dev_test.go:55
    should show validation errors if the devfile is incorrect [It]
    /workspace/c1645ecf-e7f2-4095-8aff-fbec607d1fa1/tests/integration/devfile/cmd_dev_test.go:61

    Timed out after 360.001s.
    Expected
        <string>:   __
         /  \__     Developing using the wgpujt Devfile
         \__/  \    Namespace: cmd-dev-test61nde
         /  \__/    odo version: v3.0.0-alpha1
         \__/
        
        ↪ Deploying to the cluster in developer mode
         •  Waiting for Kubernetes resources  ...
         ✗  Waiting for Kubernetes resources [32s]
        Cleaning resources, please wait
        
    to contain substring
        <string>: Press Ctrl+c to exit `odo dev` and delete resources from the cluster

    /workspace/c1645ecf-e7f2-4095-8aff-fbec607d1fa1/tests/helper/helper_run.go:39
------------------------------


Summarizing 1 Failure:

[Fail] odo dev command tests when a component is bootstrapped and pushed [It] should show validation errors if the devfile is incorrect 
/workspace/c1645ecf-e7f2-4095-8aff-fbec607d1fa1/tests/helper/helper_run.go:39

Ran 122 of 122 Specs in 426.984 seconds
FAIL! -- 121 Passed | 1 Failed | 0 Pending | 0 Skipped

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label May 6, 2022
@feloy
Copy link
Contributor

feloy commented May 6, 2022

/approve

@openshift-ci
Copy link

openshift-ci bot commented May 6, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: feloy

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. label May 6, 2022
@feloy
Copy link
Contributor

feloy commented May 6, 2022

/override Kubernetes Integration Tests/Kubernetes Integration Tests

@openshift-ci
Copy link

openshift-ci bot commented May 6, 2022

@feloy: Overrode contexts on behalf of feloy: Kubernetes Integration Tests/Kubernetes Integration Tests

In response to this:

/override Kubernetes Integration Tests/Kubernetes Integration Tests

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.

@openshift-merge-robot openshift-merge-robot merged commit ee17f5f into redhat-developer:main May 6, 2022
@mohammedzee1000 mohammedzee1000 deleted the git_df_registry branch May 9, 2022 07:06
cdrage pushed a commit to cdrage/odo that referenced this pull request Aug 31, 2022
* Removing support for github based registries

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Updating tests

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Renaming some funcs

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Adding https://github.com/devfile/registry-support info

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Commenting out unused const

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Removing potential for github registry use in odo init

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Removing unused constant

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Reversing order

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Making error more readable

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Simpifying test

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing as per @Armels comments

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Update pkg/odo/cli/preference/registry/util/util.go

Co-authored-by: Armel Soro <armel@rm3l.org>

* Updating uts

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

Co-authored-by: Armel Soro <armel@rm3l.org>
@rm3l rm3l added v3 and removed v3 labels Oct 7, 2022
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. Required by Prow. kind/task Issue is actionable task lgtm Indicates that a PR is ready to be merged. Required by Prow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove support for github based devfile registries
4 participants