Skip to content

Commit 22d46a0

Browse files
fix fragment links for batch-spec-yaml-reference (#1063)
Links to fragments (bookmarks) in `batch-spec-yaml-reference` were incorrect: they contained dashes where dots are in the headings, but the bookmark generator (`GithubSlugger`) creates ids by removing alpha-numeric characters and encoding spaces as dashes, so the links with dashes where there were dots didn't work. Remove all dashes; spot test the links. Also did some general fixup of `batch-spec-yaml-reference` links, where the dashes were underscores, and fixed a redirector that was directing to the wrong location. Tacked on a similar fix in `docs/admin/code_hosts/bitbucket_server.mdx` --------- Co-authored-by: Maedah Batool <[email protected]>
1 parent 181c280 commit 22d46a0

13 files changed

+3892
-603
lines changed

docs/admin/code_hosts/bitbucket_server.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ As an admin user, go to the "Application Links" page. You can use the sidebar na
8888

8989
> 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:
9090
91-
- [Bitbucket v7.20 and above](#bitbucket-v7-20-and-above)
92-
- [Bitbucket v7.19 and below](#bitbucket-v7-19-and-below)
91+
- [Bitbucket v7.20 and above](#bitbucket-v720-and-above)
92+
- [Bitbucket v7.19 and below](#bitbucket-v719-and-below)
9393

9494
#### Bitbucket v7.20 and above
9595

docs/batch-changes/batch-spec-templating.mdx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ run: goimports -w cmd/src/main.go internal/fmt/fmt.go
4343

4444
Templating is supported in the following fields:
4545

46-
- [`steps.run`](/batch-changes/batch-spec-yaml-reference#steps-run)
47-
- [`steps.env`](/batch-changes/batch-spec-yaml-reference#steps-env) values
48-
- [`steps.files`](/batch-changes/batch-spec-yaml-reference#steps-files) values
49-
- [`steps.outputs.<name>.value`](/batch-changes/batch-spec-yaml-reference#steps-outputs)
50-
- [`steps.if`](/batch-changes/batch-spec-yaml-reference#steps-if)
51-
- [`changesetTemplate.title`](/batch-changes/batch-spec-yaml-reference#changesettemplate-title)
52-
- [`changesetTemplate.body`](/batch-changes/batch-spec-yaml-reference#changesettemplate-body)
53-
- [`changesetTemplate.branch`](/batch-changes/batch-spec-yaml-reference#changesettemplate-branch)
54-
- [`changesetTemplate.commit.message`](/batch-changes/batch-spec-yaml-reference#changesettemplate-commit-message)
55-
- [`changesetTemplate.commit.author.name`](/batch-changes/batch-spec-yaml-reference#changesettemplate-commit-author)
56-
- [`changesetTemplate.commit.author.email`](/batch-changes/batch-spec-yaml-reference#changesettemplate-commit-author)
46+
- [`steps.run`](/batch-changes/batch-spec-yaml-reference#stepsrun)
47+
- [`steps.env`](/batch-changes/batch-spec-yaml-reference#stepsenv) values
48+
- [`steps.files`](/batch-changes/batch-spec-yaml-reference#stepsfiles) values
49+
- [`steps.outputs.<name>.value`](/batch-changes/batch-spec-yaml-reference#stepsoutputsnamevalue)
50+
- [`steps.if`](/batch-changes/batch-spec-yaml-reference#stepsif)
51+
- [`changesetTemplate.title`](/batch-changes/batch-spec-yaml-reference#changesettemplatetitle)
52+
- [`changesetTemplate.body`](/batch-changes/batch-spec-yaml-reference#changesettemplatebody)
53+
- [`changesetTemplate.branch`](/batch-changes/batch-spec-yaml-reference#changesettemplatebranch)
54+
- [`changesetTemplate.commit.message`](/batch-changes/batch-spec-yaml-reference#changesettemplatecommitmessage)
55+
- [`changesetTemplate.commit.author.name`](/batch-changes/batch-spec-yaml-reference#changesettemplatecommitauthor)
56+
- [`changesetTemplate.commit.author.email`](/batch-changes/batch-spec-yaml-reference#changesettemplatecommitauthor)
5757

5858
## Template variables
5959

@@ -102,7 +102,7 @@ The following template variables are available in the fields under `changesetTem
102102
| `steps.added_files` | `list of strings` | List of files that have been added by the `steps`. Empty list if no files have been added |
103103
| `steps.deleted_files` | `list of strings` | List of files deleted by the `steps`. Empty list if no files have been deleted |
104104
| `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 |
105-
| `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 |
105+
| `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 |
106106
| `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 |
107107

108108
## Template helper functions
@@ -212,7 +212,7 @@ changesetTemplate:
212212
The second step left this one: ${{ outputs.otherMessage }}
213213
```
214214

215-
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:
215+
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:
216216

217217
```yaml
218218
steps:
@@ -244,7 +244,7 @@ changesetTemplate:
244244
${{ end }}
245245
```
246246
247-
Using the [`steps.if`](/batch-changes/batch-spec-yaml-reference#steps-if) field to conditionally execute different steps in different repositories:
247+
Using the [`steps.if`](/batch-changes/batch-spec-yaml-reference#stepsif) field to conditionally execute different steps in different repositories:
248248

249249
```yaml
250250
steps:

docs/batch-changes/bulk-operations-on-changesets.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Below is a list of supported bulk operations for changesets and the conditions w
3535
| **Re-enqueue** | Re-enqueues the pending changes for all selected changesets that failed |
3636
| **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 |
3737
| **Close** | Close the selected changesets on the code hosts |
38-
| **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 |
38+
| **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 |
3939
| **Export** | Export selected changesets that you can use for later use |
4040

4141
## Monitoring bulk operations

docs/batch-changes/create-a-batch-change.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ changesetTemplate:
4949
published: false # Do not publish any changes to the code hosts yet
5050
```
5151
52-
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.
52+
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.
5353

5454
<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>
5555

docs/batch-changes/faq.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ There's a rule of thumb:
6060
## Can I create tickets or issues along with Batch Changes?
6161

6262
Batch Changes does not support a declarative syntax for issues or tickets.
63-
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:
63+
However, [steps](/batch-changes/batch-spec-yaml-reference#stepsrun) can run any container. Some users have built scripts to create tickets for each apply:
6464

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

8585
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.
8686

87-
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.
87+
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.
8888

8989
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:
9090

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

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

139-
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.
139+
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.
140140

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

143143
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:
144144

145145
- The changeset is already published (we cannot unpublish a changeset or convert it back to a draft)
146-
- 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
146+
- 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
147147
- You do not have permission to publish to the repository the changeset would be opened against
148148
- The changeset was imported (and was therefore already published by someone or something else)
149149

docs/batch-changes/publishing-changesets.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ changesetTemplate:
109109
Then run the `src batch preview` command again or `src batch apply` to publish the changesets immediately. Publishing a changeset will:
110110

111111
- Create a commit with the changes from the patches for that repository
112-
- 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
112+
- 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
113113
- Create a changeset (e.g., GitHub pull request) on the code host for review and merging
114114

115115
<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>
@@ -135,7 +135,7 @@ changesetTemplate:
135135
- github.com/sourcegraph-private/*: false
136136
```
137137

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

140140
### Publishing changesets as drafts
141141

@@ -149,13 +149,13 @@ changesetTemplate:
149149
published: draft
150150
```
151151

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

154154
### Fully publishing draft changesets
155155

156156
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`.
157157

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

160160
## Within the UI
161161

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

194194
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.
195195

196-
<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>
196+
<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>

docs/batch-changes/quickstart.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ changesetTemplate:
6666
message: Append Hello World to all README files
6767
```
6868
69-
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.
69+
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.
7070

7171
## Create the batch change
7272

0 commit comments

Comments
 (0)