Skip to content

Commit ba6d850

Browse files
authored
Repo sync (#1180)
This is an automated pull request to sync changes between the public and private unified docs repos. To preserve continuity across repos, _do not squash_ this pull request.
2 parents fe4b7cc + 275ce0b commit ba6d850

File tree

3 files changed

+156
-21
lines changed

3 files changed

+156
-21
lines changed

.github/workflows/create-tfe-release-notes.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,20 @@ env:
3434
LAST_RELEASE_TAG: ${{ inputs.last-release-tag }}
3535

3636
jobs:
37-
copy-docs:
38-
uses: ./.github/workflows/copy-cloud-docs-for-tfe.yml
37+
sync-docs:
38+
uses: ./.github/workflows/sync-docs-for-tfe.yml
3939
with:
4040
version: ${{ inputs.version }}
4141
secrets: inherit
4242
release-notes:
43-
needs: copy-docs
43+
needs: sync-docs
4444
runs-on: ubuntu-latest
4545
steps:
46-
- name: Print outputs from copy-docs
46+
- name: Print outputs from sync-docs
4747
run: |
48-
echo "release_branch_name: ${{ needs.copy-docs.outputs.release_branch_name }}"
49-
echo "diff_branch_pr_url: ${{ needs.copy-docs.outputs.diff_branch_pr_url }}"
50-
echo "release_branch_pr_url: ${{ needs.copy-docs.outputs.release_branch_pr_url }}"
48+
echo "release_branch_name: ${{ needs.sync-docs.outputs.release_branch_name }}"
49+
echo "diff_branch_pr_url: ${{ needs.sync-docs.outputs.diff_branch_pr_url }}"
50+
echo "release_branch_pr_url: ${{ needs.sync-docs.outputs.release_branch_pr_url }}"
5151
5252
- name: Only run in hashicorp/web-unified-docs-internal
5353
run: |
@@ -59,7 +59,7 @@ jobs:
5959
- name: Checkout web-unified-docs repository
6060
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
6161
with:
62-
ref: '${{ needs.copy-docs.outputs.release_branch_name }}'
62+
ref: '${{ needs.sync-docs.outputs.release_branch_name }}'
6363

6464
- name: Install and cache Ruby gems at root
6565
uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # v1.191.0
@@ -74,7 +74,7 @@ jobs:
7474

7575
- name: Turn branch into PR
7676
run: |
77-
export RELEASE_BRANCH_NAME="${{ needs.copy-docs.outputs.release_branch_name }}"
77+
export RELEASE_BRANCH_NAME="${{ needs.sync-docs.outputs.release_branch_name }}"
7878
RELEASE_NOTES_PR_URL=$(scripts/tfe-releases/ci/create-pull-request.sh)
7979
echo "RELEASE_NOTES_PR_URL=$RELEASE_NOTES_PR_URL" >> $GITHUB_ENV
8080
@@ -134,10 +134,10 @@ jobs:
134134
- ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}
135135
136136
Changes since last release, diff PR:
137-
- ${{ needs.copy-docs.outputs.diff_branch_pr_url }}
137+
- ${{ needs.sync-docs.outputs.diff_branch_pr_url }}
138138
139139
Release Notes PR:
140-
- ${{ needs.copy-docs.outputs.release_branch_pr_url }}
140+
- ${{ needs.sync-docs.outputs.release_branch_pr_url }}
141141
142142
143143
❗ This is the Release PR that will be merged into main, once the release notes and diff PR are merged into it. ❗
@@ -149,5 +149,5 @@ jobs:
149149
git config --global user.email "team-rel-eng@hashicorp.com"
150150
git config --global user.name "tfe-release-bot"
151151
152-
gh pr edit ${{ needs.copy-docs.outputs.release_branch_pr_url }} \
152+
gh pr edit ${{ needs.sync-docs.outputs.release_branch_pr_url }} \
153153
--body="${{env.docs_pr_body}}"
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Sync Cloud Docs For TFE
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'The TFE version for the upcoming TFE release, format is either vYYYYMM-# or MAJOR.MINOR.PATCH (without a "v" prefix).'
8+
required: true
9+
type: string
10+
workflow_call:
11+
inputs:
12+
version:
13+
description: 'The TFE version for the upcoming TFE release, format is either vYYYYMM-# or MAJOR.MINOR.PATCH (without a "v" prefix).'
14+
required: true
15+
type: string
16+
outputs:
17+
release_branch_name:
18+
description: 'The name of the branch created for the new TFE version docs.'
19+
value: ${{ jobs.sync-docs.outputs.release_branch_name }}
20+
release_branch_pr_url:
21+
description: 'The URL of the release branch created for the new TFE version docs.'
22+
value: ${{ jobs.sync-docs.outputs.release_branch_pr_url }}
23+
diff_branch_pr_url:
24+
description: 'The URL of the diff branch created for the new TFE version docs.'
25+
value: ${{ jobs.sync-docs.outputs.diff_branch_pr_url }}
26+
27+
jobs:
28+
sync-docs:
29+
name: Sync Cloud Docs
30+
runs-on: ubuntu-latest
31+
outputs:
32+
release_branch_name: ${{ steps.check-docs-pr.outputs.docs_branch_name }}
33+
release_branch_pr_url: ${{ steps.check-docs-pr.outputs.release_branch_pr_url }}
34+
diff_branch_pr_url: ${{ steps.update-diff-branch.outputs.diff_branch_pr_url }}
35+
steps:
36+
- name: Series/Release Summary
37+
run: |
38+
echo "# Summary" >> $GITHUB_STEP_SUMMARY
39+
echo "**Workflow ref**: ${{github.ref_name}}" >> $GITHUB_STEP_SUMMARY
40+
echo "" >> $GITHUB_STEP_SUMMARY
41+
echo "Triggered by branch creation (or manual workflow):" >> $GITHUB_STEP_SUMMARY
42+
echo "" >> $GITHUB_STEP_SUMMARY
43+
echo "" >> $GITHUB_STEP_SUMMARY
44+
echo "---" >> $GITHUB_STEP_SUMMARY
45+
46+
- name: Checkout main for new docs version
47+
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
48+
with:
49+
path: '${{github.workspace}}/new-docs'
50+
51+
- name: Check if new TFE version docs branch already exist
52+
id: check-docs-pr
53+
working-directory: '${{github.workspace}}/new-docs'
54+
env:
55+
docs_branch_name: tfe-release/${{inputs.version}}
56+
diff_branch_name: HCPTF-diff/${{inputs.version}}
57+
run: |
58+
echo ${{ secrets.TFE_GITHUB_TOKEN }} | gh auth login --with-token
59+
git config --global user.email "team-rel-eng@hashicorp.com"
60+
git config --global user.name "tfe-release-bot"
61+
62+
if [ "$(git ls-remote --heads origin ${{env.docs_branch_name}})" == "" ]; then
63+
echo "❌ branch name ${{env.docs_branch_name}} does not exists, please run copy cloud docs for tfe workflow first to create the branch."
64+
65+
echo "❌ branch name ${{env.docs_branch_name}} does not exists, please run copy cloud docs for tfe workflow first to create the branch." >> $GITHUB_STEP_SUMMARY
66+
67+
exit 1
68+
fi
69+
70+
if [ "$(git ls-remote --heads origin ${{env.diff_branch_name}})" == "" ]; then
71+
echo "❌ branch name ${{env.diff_branch_name}} does not exists, please run copy cloud docs for tfe workflow first to create the branch."
72+
73+
echo "❌ branch name ${{env.diff_branch_name}} does not exists, please run copy cloud docs for tfe workflow first to create the branch." >> $GITHUB_STEP_SUMMARY
74+
75+
exit 1
76+
fi
77+
78+
echo "docs_branch_name=${{env.docs_branch_name}}" >> $GITHUB_OUTPUT
79+
docs_pr_url=$(gh pr view ${{env.docs_branch_name}} --json url --jq '.url')
80+
echo "release_branch_pr_url=${docs_pr_url}" >> $GITHUB_OUTPUT
81+
echo "**TFE Release PR URL**: ${docs_pr_url}" >> $GITHUB_STEP_SUMMARY
82+
83+
- name: Generate version-metadata for workflow
84+
working-directory: '${{github.workspace}}/new-docs'
85+
run: |
86+
npm i
87+
npm run prebuild -- --only-build-version-metadata
88+
89+
- name: Checkout HCPTF-diff for new docs version DIFF PR
90+
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
91+
with:
92+
path: '${{github.workspace}}/new-docs-diff-pr'
93+
ref: 'HCPTF-diff/${{inputs.version}}'
94+
95+
- name: Copy files for new docs version DIFF PR
96+
uses: ./new-docs/.github/actions/copy-cloud-docs-for-tfe
97+
with:
98+
source_path: '${{github.workspace}}/new-docs'
99+
target_path: '${{github.workspace}}/new-docs-diff-pr'
100+
new_TFE_version: ${{inputs.version}}
101+
102+
- name: Update existing docs version DIFF branch
103+
id: update-diff-branch
104+
working-directory: '${{github.workspace}}/new-docs-diff-pr'
105+
env:
106+
diff_branch_name: HCPTF-diff/${{inputs.version}}
107+
run: |
108+
echo ${{ secrets.TFE_GITHUB_TOKEN }} | gh auth login --with-token
109+
git config --global user.email "team-rel-eng@hashicorp.com"
110+
git config --global user.name "tfe-release-bot"
111+
112+
git add .
113+
git commit -m "HCP TF changes for TFE release" --no-verify || echo "No changes to commit"
114+
git push origin HEAD
115+
116+
diff_pr_url=$(gh pr view --json url --jq '.url')
117+
echo "diff_branch_pr_url=${diff_pr_url}" >> $GITHUB_OUTPUT
118+
echo "**Updated DIFF branch**: ${{env.diff_branch_name}}" >> $GITHUB_STEP_SUMMARY
119+
echo "**TFE DIFF PR URL**: ${diff_pr_url}" >> $GITHUB_STEP_SUMMARY

docs/workflows/infrastructure-group/publish-tfe-docs.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ This page describes the process for publishing Terraform Enterprise documentatio
66

77
The team releases a milestone or major version once a quarter and releases patches as they become available.
88

9+
## Artifacts for next major release
10+
11+
After the release of a major verson, the release engineer runs a GitHub [workflow]((https://github.com/hashicorp/web-unified-docs-internal/actions/workflows/copy-cloud-docs-for-tfe.yml)) in the `web-unified-docs-internal` repository that creates the following artifacts:
12+
13+
- A branch named `tfe-release/<milestone>.<major>.x` for assembling the release notes and documentation updates. This is the branch that you merge into `main` to publish the docs.
14+
- A branch named `HCPTF-diff/<milestone>.<major>.x` that contains a diff of all of the new content from HCP TF slated for the next Terraform Enterprise release. This branch will be updated with latest changes before next release.
15+
- A PR named `HCP TF changes for TFE release <milestone>.<major>.x` for merging content updates into the release notes into the assembly branch. Review this PR and merge into the assembly branch.
16+
- A PR named `TFE Release <milestone>.<major>.x` for merging the release notes into the assembly branch.
17+
18+
Refer to the [TFE Release 1.0.0](https://github.com/hashicorp/web-unified-docs-internal/pull/299) to see examples of the app deadline artifacts.
19+
920
## Get the release date
1021

1122
Check the `#proj-tfe-releases` channel for a message from the team manager about important dates. For example:
@@ -20,14 +31,7 @@ More details -
2031

2132
Ask for the dates in the channel if it has been more than six weeks since the last milestone or major version and the manager hasn't posted the dates yet. You should also verify that the dates haven't changed closer to the standing date.
2233

23-
**Application Code Deadline**: Also called **app deadline**, this is the Terraform Enterprise code freeze and occurs 1.5 to 2 weeks before the release date. App deadline is also when the release engineer runs a GitHub workflow in the `web-unified-docs-internal` repository that creates the following artifacts:
24-
25-
- A branch named `tfe-release/<milestone>.<major>.x` for assembling the release notes and documentation updates. This is the branch that you merge into `main` to publish the docs.
26-
- A branch named `HCPTF-diff/<milestone>.<major>.x` that contains a diff of all of the new content from HCP TF slated for the next Terraform Enterprise release.
27-
- A PR named `HCP TF changes for TFE release <milestone>.<major>.x` for merging content updates into the release notes into the assembly branch. Review this PR and merge into the assembly branch.
28-
- A PR named `TFE Release <milestone>.<major>.x` for merging the release notes into the assembly branch.
29-
30-
Refer to the [TFE Release 1.0.0](https://github.com/hashicorp/web-unified-docs-internal/pull/299) to see examples of the app deadline artifacts.
34+
**Application Code Deadline**: Also called **app deadline**, this is the Terraform Enterprise code freeze and occurs 1.5 to 2 weeks before the release date. App deadline is also when the release engineer runs a GitHub [workflow]((https://github.com/hashicorp/web-unified-docs-internal/actions/workflows/create-tfe-release-notes.yml)) in the `web-unified-docs-internal` repository. The workkflow creates the release notes and updates the `HCPTF-diff/<milestone>.<major>.x` branch with latest changes from terraform common docs.
3135

3236
**Backport Deadline**: This is an engineering deadline and isn't actionable for IPG team members.
3337

@@ -62,7 +66,19 @@ This section contains supplementary information for publishing Terraform Enterpr
6266

6367
### Manually create docs artifacts for the release
6468

65-
The [Create TFE Release Notes](https://github.com/hashicorp/web-unified-docs-internal/actions/workflows/create-tfe-release-notes.yml) action creates the release notes PR and triggers the [Copy Cloud Docs For TFE](https://github.com/hashicorp/web-unified-docs-internal/actions/workflows/copy-cloud-docs-for-tfe.yml) action. These actions create the branches and PRs necessary for publishing a new version of the Terraform Enterprise documenation. Complete the following steps to manually run the actions:
69+
#### Create the artifacts for next release
70+
71+
The [Copy Cloud Docs For TFE](https://github.com/hashicorp/web-unified-docs-internal/actions/workflows/copy-cloud-docs-for-tfe.yml) action creates the branches and PRs necessary for publishing a new version of the Terraform Enterprise documenation. Complete the following steps to manually run the actions:
72+
73+
1. Log into GitHub and navigate to the `web-unified-docs-internal` repository.
74+
1. Click **Actions**, then choose **Copy Cloud Docs For TFE** from the **Actions** sidebar.
75+
1. Open the **Run workflow** dropdown and choose the branch to use to run the workflow. This is `main` in almost all cases.
76+
1. Specify the following values:
77+
- Enter the upcoming version of the TFE release.
78+
79+
#### Create the release notes PR
80+
81+
The [Create TFE Release Notes](https://github.com/hashicorp/web-unified-docs-internal/actions/workflows/create-tfe-release-notes.yml) action creates the release notes PR. Complete the following steps to manually run the actions:
6682

6783
1. Log into GitHub and navigate to the `web-unified-docs-internal` repository.
6884
1. Click **Actions**, then choose **Create TFE Release Notes** from the **Actions** sidebar.

0 commit comments

Comments
 (0)