Skip to main content

Working with the Gearset Agent

Explains how to give work to the Gearset Agent and how it integrates with an existing pipeline.

Written by Patrick Boyd

The Gearset Agent is a secure, cloud-based software factory that integrates with your existing deployment pipeline, allowing you to rapidly go from requirements to deployed changes, integrating with all the governance and controls that Gearset pipelines provide.

It can take a piece of work from ticket to pull request without you leaving the pipeline view, or you can access it from the Build menu in the sidebar.

This guide covers the full flow of the Gearset Agent including picking your environment, linking a ticket, committing changes from your dev sandbox, and opening a pull request.

Before you start

You need:

  • A Gearset pipeline with your dev sandbox added as an environment

  • Your version control system connected to the pipeline: GitHub, GitLab, Bitbucket, or Azure DevOps

  • Jira or Azure DevOps work items enabled on the pipeline, if you want to link tickets

To enable ticket linking, select the cog icon on your pipeline, then Edit pipeline details, then the Jira tab, then Enable Jira Integration with this pipeline. Repeat this for each pipeline that needs it.

Accessing the Gearset Agent

From your pipeline

Go to the Deployment pipelines page and open your pipeline. Select your dev sandbox, usually your own personal sandbox or the one your team assigned to you.

This is your entry point into the pipeline. Everything that follows happens from this environment.

Select the Build option to open the Gearset Agent

From the sidebar

If you choose to access the Gearset Agent from the sidebar, you will be prompted to Connect an environment from your pipeline. This will be the target of the pull request we open once you are happy with the changes the agent has made.

Selecting Connect environment will bring up a modal with a drop down, where you can then select the pipeline you want to connect to the Gearset Agent.

Once the pipeline you wish to connect is select, this will then bring up an Environment drop down.

From this select which environment you want connected to the Gearset Agent to deploy changes too to test them before opening a pull request to the pipeline. This should ideally be a developer sandbox.

Select Continue and you will return to the Gearset Agent prompt. you will see your pipeline name and connected sandbox name displayed in the bottom left of the prompt.

If you selected the incorrect pipeline or sandbox, you can change this by clicking on it in the bottom left of the prompt to bring back up the previous modal before starting your interaction with the Gearset Agent

Creating a request for change

There are two options when requesting a change, you can either write your own prompt describing what you need in the prompt window and select the submit arrow:

Or, with Jira or Azure DevOps enabled on the pipeline, search for and select the relevant ticket by name or number.

Once you select your Jira ticket, you will see the prompt appear in the prompt window that the Gearset Agent is going to action.

You will also see the options to select a different Jira ticket if you would prefer to work on another one, or selected the incorrect Jira ticket.

Once you have selected the right ticket, select the submit arrow:

The Agents workflow

Whether you choose to type in your prompt or select from Jira, the Gearset Agent will then start work. The Agent analyzes the existing metadata in your repository to gain context on your setup, then starts planning how to execute the request.

If the agent needs more information it will ask clarifying questions to narrow down what you need before it starts building.

You will see this appear as a question at the bottom of the screen, with a set of responses to select:

Select the response that you require, and the agent will continue.

Once the Agent finishes, it presents a summary of the proposed changes. Review this carefully so you understand the full scope of what's changing before you approve it. You can approve the changes as they are, or ask the Agent to revise the proposal until it matches what you need.

If you are happy with what you can see, then select the Approve the plan and start building option.

If you want to see the plan in more detail select the View full details option:

This will pop out the plan so you can read this in full before approving.

If you are happy with the plan, select Approve and start building

If you would like any changes, type those into prompt and the Gearset Agent will put your changes into the plan.

Once you approve the plan and select Approve the plan and Start building, the Agent builds the changes. The exact XML that will be deployed appears on the right-hand side of the screen, this is a good opportunity to review what's about to be deployed before you go further.

The Gearset Agent will automatically create you a branch name, you can edit the branch name at this point by selecting the pen icon next to it.

Testing and deployment

Once your change is built, you then have two options

  1. Test - Deploy the the changes in your dev sandbox to test them

  2. Create PR - Create a pull request to the environment linked to that dev sandbox in your pipeline.

Test

Selecting Test will bring up a drop down of orgs that you can select to deploy your change to to test in.

The org you selected at the start of the Gearset Agent process is automatically selected to deploy your test changes too. If you want to change this select a different org from the drop down.

Select Create deployment package to instruct the agent to build you a deployment package.

Once this is ready you will see this appear like so:

Select Open package to open a new browser tab displaying the Summary of items to deploy comparison screen where you can then validate or deploy your changes to the org.

Once you have tested your change, you can head back to the Gearset Agent to either instruct it to make changes, or create a PR containing those changes.

Create PR

Select Create PR once you are ready to create the PR containing your change.

This will open the Create pull request screen, with the Title and Description pre populated. You can edit these as you see necessary for your requirements.

Select Create pull request to open the PR in your pipeline.

Select View in pipeline to open your pipeline and see the PR and its status. You can now push the PR and your change through the pipeline as you require.

Did this answer your question?