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

Major: Orb Tools Version 12 #181

Merged
merged 37 commits into from
May 8, 2023
Merged

Major: Orb Tools Version 12 #181

merged 37 commits into from
May 8, 2023

Conversation

KyleTryon
Copy link
Contributor

@KyleTryon KyleTryon commented Dec 29, 2022

Orb Tools 12

⭐ Dynamic Orb Injection Without Publication

The major goal of this PR is to decrease friction in orb contributions. Currently, in order to contribute to an orb, you must have access to a secured Restricted Context in CircleCI which contains a publishing token, so that a development version of the orb may be tested in the following dynamic workflow. This means, when a contributor opens a PR, they must wait for a maintainer to re-push the code for the proper permissions. This slows down the dev cycle a lot.

With this change, rather than publishing a new development version of the orb, we modify the dynamic config template to inject the orb source as an "internal" orb within the continue job. This has the same net-effect for testing your orbs but not longer requires access to secrets, eliminating blockers top the PR process.

Other Improvements

Blocked By

  • Prepare update to https://github.com/CircleCI-Public/Orb-Template/tree/main
  • Verify Major Version Change will not negatively impact the orb init CLI command
  • Is any auto-migration assistance needed? Investigate further the difficulty in upgrading
  • Prepare any changes needed to the documentation

migrate.sh Outdated Show resolved Hide resolved
migrate.sh Outdated Show resolved Hide resolved
KyleTryon and others added 2 commits May 8, 2023 14:00
Co-authored-by: Eric Ribeiro <ericribeiro@outlook.com.br>
Co-authored-by: Eric Ribeiro <ericribeiro@outlook.com.br>
@KyleTryon KyleTryon marked this pull request as ready for review May 8, 2023 18:02
@KyleTryon KyleTryon requested a review from a team as a code owner May 8, 2023 18:02
Copy link
Contributor

@EricRibeiro EricRibeiro left a comment

Choose a reason for hiding this comment

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

Thank you!

@KyleTryon KyleTryon merged commit 000e774 into master May 8, 2023
2 checks passed
@wyardley
Copy link
Contributor

wyardley commented May 8, 2023

Was it intentional to remove resource_class (e.g. from the publish step)?

@KyleTryon
Copy link
Contributor Author

Hey @wyardley Yes! We changed away from statically defined images, where we were required to pass through parameters such as resource_class, simply to a parameterized executor. This gives a lot more flexibility outside of just resource class, but also any parameter that might exist for any executor you choose.

You should now be able to do something like looks like this:

orbs:
  orb-tools: circleci/orbtools@12
executors:
  my-exec:
    docker:
      - image: cimg/base:stable
    resource_class: small

workflows:
  example:
    jobs:
      - orb-tools/pack:
          executor: my-exec

Now the executor can come from anywhere, such as an orb, or be defined locally. When defined, or redefined locally, we can pass any parameters we want into the definition of the executor.

@wyardley
Copy link
Contributor

wyardley commented May 9, 2023

Now the executor can come from anywhere, such as an orb, or be defined locally

Probably should have been called out in the migration guide and / or breaking changes for 12.x?

IIRC, this used to not be possible? Can you give an example of using an upstream orb, but overriding a parameter like resource_class?

For me, the following gives an error

orbs:
  orb-tools: circleci/orb-tools@12.0.0
executors:
  orb-tools:
    name: orb-tools/default
    resource_class: small
workflows:
  test-pack:
    jobs:
      - orb-tools/lint:
          executor: orb-tools
{2. [#/executors/orb-tools] extraneous key [name] is not permitted}

IIRC, this used to be impossible, but maybe something has changed and I just have the wrong syntax?

(and, if it's not possible anymore, what can

resource_class:
description: Configure the executor resource class
type: enum
enum: ["small", "medium", "medium+", "large", "xlarge", "2xlarge", "2xlarge+"]
default: "medium"
be used for now?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment