I’m attempting to cut down on copy/pasta through our multiple repos by using private orbs. I’ve built a simple orb to test things out and verify our workflow and I have one sticking point, a .circleci/config.yml will not validate using circleci config validate when a private orb is referenced. I’ve committed the config.yml and it runs perfectly fine in CircleCI.
When I run the validate, I receive the following error:
➜ test git:(orbify) ✗ circleci config validate
Error: Cannot find xxx/orbtest@0.0.1 in the orb registry. Check that the namespace, orb name and version are correct.
Cannot find xxx/orbtest@0.0.1 in the orb registry. Check that the namespace, orb name and version are correct.
➜ test git:(orbify) ✗ circleci orb list xxx --private
Orbs found: 1. Showing only private orbs.
xxx/orbtest (0.0.1)
➜ test git:(orbify) ✗ circleci version
0.1.15973+ce8624c (homebrew)
As you can see, the orb is available (sorry for the masked namespace and name). Are there plans to add this functionality into the CLI anytime soon? Having to do a commit and check the CircleCI project is a bit cumbersome and wastes a fair amount of time.
@yannCI thanks! I knew I was missing something from the documentation. However, even using the org slug, I’m not able to validate and get a permission denied even though I can list the orbs fine.
➜ test git:(orbify) ✗ circleci orb list xxx --private
Orbs found: 1. Showing only private orbs.
xxx/orbtest (0.0.1)
➜ test git:(orbify) ✗ circleci config validate --org-slug xxx .circleci/config.yml
Error: Unable to validate config: Permission denied
I had seen the notes about it not working at all, so this is a big improvement (being able to specify --org-slug)!. For me, this works great, and I’m now able to validate configs with private orbs.
That said, wonder if there’s any plan to add any further improvements, like letting you set an organization to search for private orgs by default?
I tested, and populating these values (or setting org_slug there) did not seem to work, but it would be nice if the CLI config could either infer the slug from those fields in orb_publishing, or have a parallel field for validation.
This is still not working for me. Upgraded to cli version 0.1.17183 and even with the org slug option and the --token flag, commands are still failing. Without org slug, receive message “Cannot find org_name/orb_name in the orb registry.” With org slug and --token, message is “Error: Unable to validate config: Permission denied”. As the user above, I"m able to list the orbs and get orb info just fine. Are there specific permissions necessary in git or circle to validate config using a private orb?
In case this helps someone else (or me in the future), I was also getting the Error: Unable to validate config: Permission denied message and the --token parameter didn’t seem to fix it. My problem was I was passing our GitHub org name directly as --org-slug <org> instead of --org-slub github/<org>. Doing that and using --token allowed me to successfully validate my config using the CLI.
After giving up a month ago, I came back to this today and identified the problem within 3 minutes: the org-slug is case sensitive. Even though my org on github is all lowercase (accessible at github.com/{my-org}), it contains a capital letter in circleci (My-Org). I had assumed that they used the same convention, and never bothered to confirm the official circleci org name. --org-slug github/{My-Org} got things working.