Submit a Feature Request
For orbs-related bugs/issues, please submit them on the respective repo here: https://github.com/CircleCI-Public. For general feedback please use continue using this form.
15
Update Path Filtering Orb to be configurable
Recently I learned of the circleci/path-filtering orb that uses the continuation API in a Setup Workflow. This is a really powerful set of tools, except for some reason the base-revision is not something that can be dynamically controlled. While you can set the base-revision for the path filtering orb to any valid value, including other parameters, it is not possible to dynamically create a value for the base-revision. For example, if the base-revision is set to a value of master it works fine. But if we create a pre-step that gets the base revision from Github, the value cannot be used as the base revision. Relying on the pipeline.git.base-revision as a dynamic revision is not reliable, and doesn't work the way one might hope it would. In practice this means that developers using CircleCI in my project need to manually update the base-revision whenever they are working on a different base from main / master . Can the orb be updated to accept an environment variable exported into $BASH_ENV from a pre-step, or can we have some other mechanism for dynamically controlling this parameter? Ideally I would be able to do something like this version: 2.1 setup: true orbs: path-filtering: circleci/path-filtering@0.0.2 workflows: generate-config: jobs: - path-filtering/filter: pre-steps: - run: name: Fetch Base Branch from Github command: | BASE_BRANCH=$(curl -X GET \ -H "Authorization: token $GITHUB_TOKEN" \ -H "Accept: application/vnd.github.groot-preview+json" \ -L "https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/commits/$CIRCLE_SHA1/pulls" \ | jq '.[].base.ref') echo "export BASE_BRANCH=$BASE_BRANCH" >> $BASH_ENV base-revision: $BASE_BRANCH mapping: | path/to/dir/.* build-my-job true Path Filtering orb https://circleci.com/developer/orbs/orb/circleci/path-filtering
4
11
Realtime conditions for Orbs
Orbs are nice and all but it really is not useful if I can not call them with certain conditions. In CircleCI 2.0 I can do shell commands to have conditional logic, but it seems with reusable Orbs, I can not use any of those conditions since it is all YAML. Pls take a look at what Ansible did with its when condition and Jinja2 templating code. I was trying to do some conditions on environment vars but it seems CircleCI 2.1 is just preprocessed code that converts to 2.0 code so something like parameters: circle-pull-request: description: The URL of the associated pull request. If there are multiple associated pull requests, one URL is randomly chosen. type: string default: $CIRCLE_PULL_REQUEST circle-tag: description: The name of the git tag, if the current build is tagged. type: string default: $CIRCLE_TAG steps: - checkout - when: condition: << parameters.circle-pull-request >> steps: - run: | echo "when parameters.circle-pull-request: << parameters.circle-pull-request >>" - unless: condition: << parameters.circle-pull-request >> steps: - run: | echo "unless parameters.circle-pull-request: << parameters.circle-pull-request >>" - when: condition: << parameters.circle-tag >> steps: - run: | echo "when parameters.circle-tag: << parameters.circle-tag >>" - unless: condition: << parameters.circle-tag >> steps: - run: | echo "unless parameters.circle-tag: << parameters.circle-tag >>" Will not work at all and I will always get the When conditions. This is quite sad because If I want to do something as simple as use the Slack Orb to send a notification based upon something at runtime, I have to literally copy paste the Slack Orb code into my config (which is what CircleCI processing does anyway). CCI-I-721
1
Load More