diff --git a/.github/pr-comments/for-community.md b/.github/pr-comments/for-community.md new file mode 100644 index 0000000000..b449c7433c --- /dev/null +++ b/.github/pr-comments/for-community.md @@ -0,0 +1,13 @@ +:smiley_cat: Thank you for creating this PR! + +Certain labels are needed to open a pull request in the `docs-site` repo, but it looks like you may not be able to add labels. That's because you either do not have permissions or you are using a fork in your PR. To publish your content to [Zowe Docs](https://docs.zowe.org/), follow these steps. + +- [ ] Use comments to add labels to your pull request. Enter the `/labels` command in a comment to add the required `review`, `area`, and `release` label types. + - Example: Enter `/labels doc cli V2` to add the `review: doc`, `area: cli`, and `version: V2` labels to your PR. + - The `review` label indicates the kind of review your content requires. The `area` label indicates the content topic area. The `release` labels tells us the major release aligned with your content. + - See the [docs-site labels](https://github.com/zowe/docs-site/issues/labels) to see the labels are available for use. + - To remove a label, use the minus sign: `/labels -V2` +- [ ] Select the `master` branch if your PR updates content that is on the **live site**. Select `docs-staging` if your PR updates content for a future release. Use the `v3-doc-branch` for Zowe V3 content. +- [ ] Notify the Doc Squad about this PR. If you don't know whom should review your content, message the [#zowe-doc](https://openmainframeproject.slack.com/archives/CC961JYMQ) Slack channel. If you know which Doc Squad writer should approve your content, add that person as a reviewer. + +**Need help?** Contact the Doc Squad in the [#zowe-doc](https://openmainframeproject.slack.com/archives/CC961JYMQ) Slack channel. diff --git a/.github/pr-comments/for-labeller.md b/.github/pr-comments/for-labeller.md new file mode 100644 index 0000000000..34a27078a8 --- /dev/null +++ b/.github/pr-comments/for-labeller.md @@ -0,0 +1,10 @@ +:smiley_cat: Thank you for creating this PR! To publish your content to [Zowe Docs](https://docs.zowe.org/), follow these required steps. + +- [ ] Add the label `review: doc`. +- [ ] Identify your content topic with a label. (Examples: `area: apiml`, `area: cli`, `area: install and config`, etc.) +- [ ] Specify the major Zowe release(s) for your content. (Examples: `release: V1`, `release: V2`, `release: V3`) + - [ ] If adding content that needs to be removed from V3 documentation, add the `V3 N/A` tag. +- [ ] Select the `master` branch if your PR updates content that is on the **live site**. Select `docs-staging` if your PR updates content for a future release. +- [ ] Notify the Doc Squad about this PR. If you don't know whom should review your content, message the [#zowe-doc](https://openmainframeproject.slack.com/archives/CC961JYMQ) Slack channel. If you know which Doc Squad writer should approve your content, add that person as a reviewer. + +**Need help?** Contact the Doc Squad in the [#zowe-doc](https://openmainframeproject.slack.com/archives/CC961JYMQ) Slack channel. diff --git a/.github/pr-comments/for-writer.md b/.github/pr-comments/for-writer.md new file mode 100644 index 0000000000..85f21afaa0 --- /dev/null +++ b/.github/pr-comments/for-writer.md @@ -0,0 +1,10 @@ +:smiley_cat: Thank you for creating this PR! To publish your content to [Zowe Docs](https://docs.zowe.org/), follow these steps. + +- [ ] Add the label `review: sme` if an SME needs to check your content. +- [ ] Identify your content topic with a label. (Examples: `area: apiml`, `area: cli`, `area: install and config`, etc.) +- [ ] Specify the major Zowe release(s) for your content. (Examples: `release: V1`, `release: V2`, `release: V3`) + - [ ] If adding content that needs to be removed from V3 documentation, add the `V3 N/A` tag. +- [ ] Link any [Doc Issues](https://github.com/zowe/docs-site/issues) related to this PR. +- [ ] Fix broken links found in your content areas. +- [ ] Notify the SME to review this PR (if applicable). +- [ ] Merge to the `master` branch if your PR updates content that is on the live site. Merge to `docs-staging` if your PR updates content for a future release. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 209c8a8bf4..607f900923 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,12 +1,5 @@ -### Your checklist for this pull request -🚨Please review the [guidelines for contributing](../docs/contribute/contributing.md) to this repository. +Describe your pull request here: -- [ ] If the changes in this PR is part of the next future release, make this pull request against the **docs-staging** branch which will be published at the next release boundary. If the changes in this PR are part of the current release, use the default base branch, **master**. For more information about branches, see https://github.com/zowe/docs-site/tree/master#understanding-the-doc-branches. - -- [ ] If this PR relates to GitHub issues in `docs-site` or other repositories, please list in Description, prefixed with **close**, **fix** or **resolve** keywords. - -### Description (including links to related git issues) -Please describe your pull request. - -:heart:Thank you! +List the file(s) included in this PR: +After creating the PR, follow the instructions in the comments. diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index 6f7b47afec..062a261979 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -35,5 +35,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - args: "--accept 401,429 --cache --max-cache-age 1d --max-concurrency 64 --no-progress --verbose 'docs/**/*.md'" + args: "--accept 401,403,429 --cache --max-cache-age 1d --max-concurrency 64 --no-progress --verbose 'docs/**/*.md'" fail: true diff --git a/.github/workflows/pr-comment-trigger.yml b/.github/workflows/pr-comment-trigger.yml new file mode 100644 index 0000000000..cd925573bc --- /dev/null +++ b/.github/workflows/pr-comment-trigger.yml @@ -0,0 +1,80 @@ +name: PR Comment Trigger + +on: + issue_comment: + types: + - created + +jobs: + pr-comment: + runs-on: ubuntu-latest + if: ${{ github.event.issue.pull_request && github.event.comment.user.login == github.event.issue.user.login }} + + steps: + - name: Execute script if PR author commented + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.ZOWE_ROBOT_TOKEN }} + script: | + console.log("PR URL:", context.payload.issue.pull_request.url); + console.log("PR author:", context.payload.issue.user.login); + console.log("Comment author:", context.payload.comment.user.login); + const body = context.payload.comment.body; + if (body.startsWith("/labels ")) { + console.log("Comment body:", body); + const repoLabels = (await github.rest.issues.listLabelsForRepo(context.repo)).data.map((label) => label.name); + const labelMapping = {}; + for (const label of repoLabels) { + if (label.includes(": ")) { + console.log("Found repo label:", label); + labelMapping[label.replace(" ", "")] = label; + labelMapping[label.slice(label.indexOf(":") + 2)] = label; + } + } + const labelsCurrent = (await github.rest.issues.listLabelsOnIssue({ ...context.repo, issue_number: context.payload.issue.number })).data.map((label) => label.name); + console.log("PR labels:", labelsCurrent.join(", ")); + const cmdArgs = body.split(" ").slice(1); + const labelsToAdd = cmdArgs.filter((arg) => !arg.startsWith("-")).map((arg) => arg.startsWith("+") ? arg.slice(1) : arg); + console.log("Labels to add:", labelsToAdd.join(", ")); + const labelsToRemove = cmdArgs.filter((arg) => arg.startsWith("-")).map((arg) => arg.slice(1)); + console.log("Labels to remove:", labelsToRemove.join(", ")); + const labelsInvalid = []; + for (const label of labelsToAdd) { + if (labelMapping[label] == null) { + console.log("Invalid label:", label); + labelsInvalid.push(label); + } else if (labelsCurrent.includes(labelMapping[label])) { + console.log("Skipping label:", labelMapping[label]); + } else { + console.log("Adding label:", labelMapping[label]); + try { + await github.rest.issues.addLabels({ ...context.repo, issue_number: context.payload.issue.number, labels: [labelMapping[label]] }); + } catch (err) { + console.log("Failed to add label:", err); + labelsInvalid.push(label); + } + } + } + for (const label of labelsToRemove) { + if (labelMapping[label] == null) { + console.log("Invalid label:", label); + labelsInvalid.push(label); + } else if (!labelsCurrent.includes(labelMapping[label])) { + console.log("Skipping label:", labelMapping[label]); + } else { + console.log("Removing label:", labelMapping[label]); + try { + await github.rest.issues.removeLabel({ ...context.repo, issue_number: context.payload.issue.number, name: labelMapping[label] }); + } catch (err) { + console.log("Failed to remove label:", err); + labelsInvalid.push(label); + } + } + } + await github.rest.issues.deleteComment({ ...context.repo, comment_id: context.payload.comment.id }); + if (labelsInvalid.length > 0) { + console.log("Invalid labels:", labelsInvalid.join(", ")); + const bodyQuoted = body.split("\n").map((line) => "> " + line).join("\n"); + await github.rest.issues.createComment({ ...context.repo, issue_number: context.payload.issue.number, body: bodyQuoted + "\n\nThe following labels are invalid: " + labelsInvalid.join(", ") }); + } + } diff --git a/.github/workflows/pull-request-checker.yml b/.github/workflows/pull-request-checker.yml new file mode 100644 index 0000000000..976ea6d44a --- /dev/null +++ b/.github/workflows/pull-request-checker.yml @@ -0,0 +1,178 @@ +name: PR Checker + +on: + pull_request_target: + branches: + - docs-staging + - master + - anax-test-branch # TODO Delete this line before merging PR + types: [opened, reopened, edited, labeled] + +jobs: + initial-comment: + name: PR Instructions + runs-on: ubuntu-latest + if: github.event.pull_request.user.login != 'zowe-robot' + + steps: + # 1. Check out files needed by subsequent steps + - name: Checkout files + uses: actions/checkout@v4 + with: + sparse-checkout: .github + + # 2. Define outputs used by subsequent steps + - name: Check if author is writer + id: check-if-writer + if: contains(fromJson('["anaxceron", "jandacek", "nannanli", "samanthasusu", "nellietan", "lparadkar-rocket"]'), github.event.pull_request.user.login) + run: echo "PR_AUTHOR_TYPE=writer" >> $GITHUB_ENV + + - name: Check if author is labeller + id: check-if-labeller + if: ${{ steps.check-if-writer.outcome == 'skipped' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + response=$(curl -fs -H "Authorization: Token $GITHUB_TOKEN" \ + "https://api.github.com/repos/${{ github.repository }}/collaborators/${{ github.event.pull_request.user.login }}/permission") + triage_permission=$(echo "$response" | jq -r '.user.permissions.triage') + if [ "$triage_permission" == "true" ]; then + echo "PR_AUTHOR_TYPE=labeller" >> $GITHUB_ENV + else + echo "PR_AUTHOR_TYPE=community" >> $GITHUB_ENV + fi + + # 3. Add initial comment on PR + - name: Add initial comment + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: Initial comment + path: .github/pr-comments/for-${{ env.PR_AUTHOR_TYPE }}.md + only_create: true + + # 4. Validate PR description + - name: Description checker + id: description_checker + uses: jadrol/pr-description-checker-action@v1.0.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + template-path: "./.github/pull_request_template.md" + comment: false + - name: Template Not Filled Comment PR + if: failure() && steps.description_checker.outcome == 'failure' + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: Invalid PR description + message: | + :warning: Looks like something is wrong with the PR description. Remember to add a description and the file(s) included in this PR. + + If you have addressed this issue already, refresh this page in your browser to remove this comment. + - name: File type checker + id: file_type_checker + uses: JJ/github-pr-contains-action@releases/v10 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + bodyContains: '\.md|\.jpg|\.gif|\.png' + - name: Missing File Name Comment PR + if: failure() && steps.file_type_checker.outcome == 'failure' + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: Invalid PR description + message: | + :file_folder: The PR description is missing the file name(s) for the updated content. List all the files included in this PR so this information displays in our [Zowe Docs GitHub Slack channel](https://openmainframeproject.slack.com/archives/C05GH3LT59D). + + If you have addressed this issue already, refresh this page in your browser to remove this comment. + - name: Fixed Invalid Description Comment PR + if: success() + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: Invalid PR description + delete: true + + review-labels: + name: Check for missing review label + runs-on: ubuntu-latest + needs: [initial-comment] + if: ${{ always() && !contains(fromJson('["zowe-robot", "anaxceron", "jandacek", "nannanli", "samanthasusu", "nellietan", "lparadkar-rocket"]'), github.event.pull_request.user.login) }} + + steps: + - name: Review Label Check + id: prefix_label_check + uses: docker://agilepathway/pull-request-label-checker:latest + with: + prefix_mode: true + any_of: "review:" + repo_token: ${{ secrets.GITHUB_TOKEN }} + - name: Missing Review Label Comment PR + if: failure() + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: Review label missing + message: | + :mag: The **review** label is missing. Add a `review:` label so we can determine who needs to approve this PR. + + If you have addressed this issue already, refresh this page in your browser to remove this comment. + - name: Fixed Review Label Comment PR + if: success() + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: Review label missing + delete: true + + release-labels: + name: Check for missing release label + runs-on: ubuntu-latest + needs: [initial-comment] + if: ${{ always() && github.event.pull_request.user.login != 'zowe-robot' }} + + steps: + - id: prefix_label_check + uses: docker://agilepathway/pull-request-label-checker:latest + with: + prefix_mode: true + one_of: "release:" + repo_token: ${{ secrets.GITHUB_TOKEN }} + - name: Missing Release Label Comment PR + if: failure() + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: Release label missing + message: | + :floppy_disk: The **release** label is missing. Add a `release:` label so your content is published with the correct major Zowe release. + + If you have addressed this issue already, refresh this page in your browser to remove this comment. + - name: Fixed Release Label Comment PR + if: success() + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: Release label missing + delete: true + + area-labels: + name: Check for missing area label + runs-on: ubuntu-latest + needs: [initial-comment] + if: ${{ always() && github.event.pull_request.user.login != 'zowe-robot' }} + + steps: + - id: prefix_label_check + uses: docker://agilepathway/pull-request-label-checker:latest + with: + prefix_mode: true + any_of: "area:" + repo_token: ${{ secrets.GITHUB_TOKEN }} + - name: Missing Area Label Comment PR + if: failure() + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: Area label missing + message: | + :pushpin: The **subject area** label is missing. Add an `area:` label so we know what your content is about. + + If you have addressed this issue already, refresh this page in your browser to remove this comment. + - name: Fixed Area Label Comment PR + if: success() + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: Area label missing + delete: true diff --git a/versioned_docs/version-v2.12.x/getting-started/release-notes/v2_11_0.md b/versioned_docs/version-v2.12.x/getting-started/release-notes/v2_11_0.md index 4ce51f7738..8aa9467e8f 100644 --- a/versioned_docs/version-v2.12.x/getting-started/release-notes/v2_11_0.md +++ b/versioned_docs/version-v2.12.x/getting-started/release-notes/v2_11_0.md @@ -1,4 +1,4 @@ -# Version 2.11.0 (September 2023) +# Version 2.11.0 (September 2023) Welcome to the Zowe Version 2.11.0 release!