Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/admin/code_hosts/bitbucket_server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ As an admin user, go to the "Application Links" page. You can use the sidebar na

> NOTE: There has been some [changes to the flow in Bitbucket v7.20](https://confluence.atlassian.com/bitbucketserver/bitbucket-data-center-and-server-7-20-release-notes-1101934428.html). Depending on your Bitbucket version, the setup is slightly different. Please follow the instructions for the correct version of Bitbucket below:
- [Bitbucket v7.20 and above](#bitbucket-v7-20-and-above)
- [Bitbucket v7.19 and below](#bitbucket-v7-19-and-below)
- [Bitbucket v7.20 and above](#bitbucket-v720-and-above)
- [Bitbucket v7.19 and below](#bitbucket-v719-and-below)

#### Bitbucket v7.20 and above

Expand Down
28 changes: 14 additions & 14 deletions docs/batch-changes/batch-spec-templating.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ run: goimports -w cmd/src/main.go internal/fmt/fmt.go

Templating is supported in the following fields:

- [`steps.run`](/batch-changes/batch-spec-yaml-reference#steps-run)
- [`steps.env`](/batch-changes/batch-spec-yaml-reference#steps-env) values
- [`steps.files`](/batch-changes/batch-spec-yaml-reference#steps-files) values
- [`steps.outputs.<name>.value`](/batch-changes/batch-spec-yaml-reference#steps-outputs)
- [`steps.if`](/batch-changes/batch-spec-yaml-reference#steps-if)
- [`changesetTemplate.title`](/batch-changes/batch-spec-yaml-reference#changesettemplate-title)
- [`changesetTemplate.body`](/batch-changes/batch-spec-yaml-reference#changesettemplate-body)
- [`changesetTemplate.branch`](/batch-changes/batch-spec-yaml-reference#changesettemplate-branch)
- [`changesetTemplate.commit.message`](/batch-changes/batch-spec-yaml-reference#changesettemplate-commit-message)
- [`changesetTemplate.commit.author.name`](/batch-changes/batch-spec-yaml-reference#changesettemplate-commit-author)
- [`changesetTemplate.commit.author.email`](/batch-changes/batch-spec-yaml-reference#changesettemplate-commit-author)
- [`steps.run`](/batch-changes/batch-spec-yaml-reference#stepsrun)
- [`steps.env`](/batch-changes/batch-spec-yaml-reference#stepsenv) values
- [`steps.files`](/batch-changes/batch-spec-yaml-reference#stepsfiles) values
- [`steps.outputs.<name>.value`](/batch-changes/batch-spec-yaml-reference#stepsoutputsnamevalue)
- [`steps.if`](/batch-changes/batch-spec-yaml-reference#stepsif)
- [`changesetTemplate.title`](/batch-changes/batch-spec-yaml-reference#changesettemplatetitle)
- [`changesetTemplate.body`](/batch-changes/batch-spec-yaml-reference#changesettemplatebody)
- [`changesetTemplate.branch`](/batch-changes/batch-spec-yaml-reference#changesettemplatebranch)
- [`changesetTemplate.commit.message`](/batch-changes/batch-spec-yaml-reference#changesettemplatecommitmessage)
- [`changesetTemplate.commit.author.name`](/batch-changes/batch-spec-yaml-reference#changesettemplatecommitauthor)
- [`changesetTemplate.commit.author.email`](/batch-changes/batch-spec-yaml-reference#changesettemplatecommitauthor)

## Template variables

Expand Down Expand Up @@ -102,7 +102,7 @@ The following template variables are available in the fields under `changesetTem
| `steps.added_files` | `list of strings` | List of files that have been added by the `steps`. Empty list if no files have been added |
| `steps.deleted_files` | `list of strings` | List of files deleted by the `steps`. Empty list if no files have been deleted |
| `steps.path` | `string` | Path (relative to the root of the directory, no leading `/` or `.`) in which the `steps` have been executed. Empty if no workspaces have been used and the `steps` were executed in the root of the repository |
| `outputs.<name>` | depends on `outputs.<name>.format`, default: `string` | Value of an [`output`](/batch-changes/batch-spec-yaml-reference#steps-outputs) set by `steps`. If the [`outputs.<name>.format`](batch_spec_yaml_reference#steps-outputs-format) is `yaml` or `json` and the `value` a data structure (i.e., array, object, ...), then subfields can be accessed too. See [Templating Examples](#templating-examples) below |
| `outputs.<name>` | depends on `outputs.<name>.format`, default: `string` | Value of an [`output`](batch-spec-yaml-reference#stepsoutputs) set by `steps`. If the [`outputs.<name>.format`](batch-spec-yaml-reference#stepsoutputsnameformat) is `yaml` or `json` and the `value` a data structure (i.e., array, object, ...), then subfields can be accessed too. See [Templating Examples](#templating-examples) below |
| `batch_change_link` | `string` | <strong><small>Only available in `changesetTemplate.body`</small></strong><br />Link back to the batch change that produced the changeset on Sourcegraph. If omitted, the link will be automatically appended to the end of the body. <br />Requires [Sourcegraph CLI](/cli/) 3.40.9 or later |

## Template helper functions
Expand Down Expand Up @@ -212,7 +212,7 @@ changesetTemplate:
The second step left this one: ${{ outputs.otherMessage }}
```

Using the [`steps.outputs.<name>.format`](/batch-changes/batch-spec-yaml-reference#steps-outputs-name-format) field, it's possible to parse the value of output as JSON or YAML and access it as a data structure instead of just text:
Using the [`steps.outputs.<name>.format`](/batch-changes/batch-spec-yaml-reference#stepsoutputsnameformat) field, it's possible to parse the value of output as JSON or YAML and access it as a data structure instead of just text:

```yaml
steps:
Expand Down Expand Up @@ -244,7 +244,7 @@ changesetTemplate:
${{ end }}
```
Using the [`steps.if`](/batch-changes/batch-spec-yaml-reference#steps-if) field to conditionally execute different steps in different repositories:
Using the [`steps.if`](/batch-changes/batch-spec-yaml-reference#stepsif) field to conditionally execute different steps in different repositories:

```yaml
steps:
Expand Down
2 changes: 1 addition & 1 deletion docs/batch-changes/bulk-operations-on-changesets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Below is a list of supported bulk operations for changesets and the conditions w
| **Re-enqueue** | Re-enqueues the pending changes for all selected changesets that failed |
| **Merge (experimental)** | Merge the selected changesets on code hosts. Some changesets may be unmergeable due to their states, which does not impact the overall bulk operation. Failed merges are listed under the bulk operations tab. In the confirmation modal, you can opt for a squash merge strategy, available on GitHub, GitLab, and Bitbucket Cloud. For Bitbucket Server/Data Center, only regular merges are performed |
| **Close** | Close the selected changesets on the code hosts |
| **Publish** | Publishes the selected changesets, provided they don't have a [`published` field](/batch-changes/batch-spec-yaml-reference#changesettemplate-published) in the batch spec. You can choose between draft and normal changesets in the confirmation modal |
| **Publish** | Publishes the selected changesets, provided they don't have a [`published` field](/batch-changes/batch-spec-yaml-reference#changesettemplatepublished) in the batch spec. You can choose between draft and normal changesets in the confirmation modal |
| **Export** | Export selected changesets that you can use for later use |

## Monitoring bulk operations
Expand Down
2 changes: 1 addition & 1 deletion docs/batch-changes/create-a-batch-change.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ changesetTemplate:
published: false # Do not publish any changes to the code hosts yet
```
The commits created from your spec will use the `git config` values for `user.name` and `user.email` from your local environment or `[email protected]` if no user is set. Alternatively, you can also [specify an `author`](/batch-changes/batch-spec-yaml-reference#changesettemplate-commit-author) in this spec.
The commits created from your spec will use the `git config` values for `user.name` and `user.email` from your local environment or `[email protected]` if no user is set. Alternatively, you can also [specify an `author`](/batch-changes/batch-spec-yaml-reference#changesettemplatecommitauthor) in this spec.

<Callout type="info">See the [batch spec YAML reference](/batch-changes/batch-spec-yaml-reference) for more details on how to write batch specs.</Callout>

Expand Down
8 changes: 4 additions & 4 deletions docs/batch-changes/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ There's a rule of thumb:
## Can I create tickets or issues along with Batch Changes?

Batch Changes does not support a declarative syntax for issues or tickets.
However, [steps](/batch-changes/batch-spec-yaml-reference#steps-run) can run any container. Some users have built scripts to create tickets for each apply:
However, [steps](/batch-changes/batch-spec-yaml-reference#stepsrun) can run any container. Some users have built scripts to create tickets for each apply:

- [Jira tickets](https://github.com/sourcegraph/batch-change-examples/blob/main/ticketing-systems/jira-tickets/README)
- [GitHub issues](https://github.com/sourcegraph/batch-change-examples/blob/main/ticketing-systems/github-issues/README)
Expand All @@ -84,7 +84,7 @@ Unapplied batch specs are removed from the database after **seven days**.

Yes. When [executing a batch spec](/batch-changes/how-src-executes-a-batch-spec), `src` will attempt to pull missing docker images. If you are logged into the private container registry, it will pull from it.

Also, see [`steps.container`](/batch-changes/batch-spec-yaml-reference#steps-container). Within the spec, it will work as expected if `docker pulls` points to your private registry from the command line.
Also, see [`steps.container`](/batch-changes/batch-spec-yaml-reference#stepscontainer). Within the spec, it will work as expected if `docker pulls` points to your private registry from the command line.

However, outside the spec, `src` pulls an image from Docker Hub when running in volume workspace mode. This is the default on macOS, so you will need to use one of the following three workarounds:

Expand Down Expand Up @@ -136,14 +136,14 @@ Remember the context in which the inner `${{ }}` will be evaluated, and be sure

## How is commit author determined for commits produced from Batch Changes?

Commit author is determined when running `src batch [apply|preview]`. If no [author](/batch-changes/batch-spec-yaml-reference#changesettemplate-commit-author) key is defined in the batch spec, `src` will try to use the git config values for `user.name` and `user.email` from your local environment, or `[email protected]` if no user is set.
Commit author is determined when running `src batch [apply|preview]`. If no [author](/batch-changes/batch-spec-yaml-reference#changesettemplatecommitauthor) key is defined in the batch spec, `src` will try to use the git config values for `user.name` and `user.email` from your local environment, or `[email protected]` if no user is set.

## Why is the checkbox on my changeset disabled when previewing a batch change?

Since Sourcegraph 3.31, it is possible to publish many types of changesets when previewing a batch change by modifying the publication state for the changeset directly from the UI (see ["Publishing changesets"](/batch-changes/publishing-changesets#from-the-preview)). However, not every changeset can be published by Sourcegraph. By hovering over your changeset's disabled checkbox, you can see why that specific changeset is not currently publishable. The most common reasons include:

- The changeset is already published (we cannot unpublish a changeset or convert it back to a draft)
- The changeset's publication state is being controlled from your batch spec file (i.e., you have the [`published` flag set in your batch spec](/batch-changes/batch-spec-yaml-reference#changesettemplate-published)); the batch spec takes precedence over the UI
- The changeset's publication state is being controlled from your batch spec file (i.e., you have the [`published` flag set in your batch spec](/batch-changes/batch-spec-yaml-reference#changesettemplatepublished)); the batch spec takes precedence over the UI
- You do not have permission to publish to the repository the changeset would be opened against
- The changeset was imported (and was therefore already published by someone or something else)

Expand Down
10 changes: 5 additions & 5 deletions docs/batch-changes/publishing-changesets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ changesetTemplate:
Then run the `src batch preview` command again or `src batch apply` to publish the changesets immediately. Publishing a changeset will:

- Create a commit with the changes from the patches for that repository
- Push a branch using the branch name you defined in the batch spec with [`changesetTemplate.branch`](/batch-changes/batch-spec-yaml-reference#changesettemplate-branch). If [forks are enabled](/admin/config/batch_changes#forks), then the branch will be pushed to a fork of the repository
- Push a branch using the branch name you defined in the batch spec with [`changesetTemplate.branch`](/batch-changes/batch-spec-yaml-reference#changesettemplatebranch). If [forks are enabled](/admin/config/batch_changes#forks), then the branch will be pushed to a fork of the repository
- Create a changeset (e.g., GitHub pull request) on the code host for review and merging

<Callout type="note">When pushing the branch Sourcegraph will use a **force push**. Make sure that the branch names are unused otherwise, previous commits will be overwritten.</Callout>
Expand All @@ -135,7 +135,7 @@ changesetTemplate:
- github.com/sourcegraph-private/*: false
```

<Callout type="info">See [`changesetTemplate.published`](/batch-changes/batch-spec-yaml-reference#changesettemplate-published) in the batch spec reference for more details.</Callout>
<Callout type="info">See [`changesetTemplate.published`](/batch-changes/batch-spec-yaml-reference#changesettemplatepublished) in the batch spec reference for more details.</Callout>

### Publishing changesets as drafts

Expand All @@ -149,13 +149,13 @@ changesetTemplate:
published: draft
```

<Callout type="info">See [`changesetTemplate.published`](/batch-changes/batch-spec-yaml-reference#changesettemplate-published) in the batch spec reference for more details.</Callout>
<Callout type="info">See [`changesetTemplate.published`](/batch-changes/batch-spec-yaml-reference#changesettemplatepublished) in the batch spec reference for more details.</Callout>

### Fully publishing draft changesets

If you have previously published changesets as drafts on code hosts by setting `published` to `draft`, you then fully publish them and take them out of draft mode by updating the `published` to `true`.

<Callout type="info">See [`changesetTemplate.published`](/batch-changes/batch-spec-yaml-reference#changesettemplate-published) in the batch spec reference for more details.</Callout>
<Callout type="info">See [`changesetTemplate.published`](/batch-changes/batch-spec-yaml-reference#changesettemplatepublished) in the batch spec reference for more details.</Callout>

## Within the UI

Expand Down Expand Up @@ -193,4 +193,4 @@ Once applied, you can select the changesets you want to publish from the batch c

Regardless of how you publish your changesets, the commit created and pushed to the branch uses the details specified in the batch spec's `changesetTemplate` field.

<Callout type="info">See [`changesetTemplate.commit`](/batch-changes/batch-spec-yaml-reference#changesettemplate-commit) for details on how to set the author and the commit message.</Callout>
<Callout type="info">See [`changesetTemplate.commit`](/batch-changes/batch-spec-yaml-reference#changesettemplatecommit) for details on how to set the author and the commit message.</Callout>
2 changes: 1 addition & 1 deletion docs/batch-changes/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ changesetTemplate:
message: Append Hello World to all README files
```
The commits you create here will use the `git config` values for `user.name` and `user.email` from your local environment or `[email protected]` if no user is set. Alternatively, you can also [specify an `author`](/batch-changes/batch-spec-yaml-reference#changesettemplate-commit-author) in this spec.
The commits you create here will use the `git config` values for `user.name` and `user.email` from your local environment or `[email protected]` if no user is set. Alternatively, you can also [specify an `author`](/batch-changes/batch-spec-yaml-reference#changesettemplatecommitauthor) in this spec.

## Create the batch change

Expand Down
Loading