Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anax test branch #3273

Merged
merged 92 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from 88 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
9d3213b
testing new label checker
anaxceron Jul 7, 2023
67f1b2c
adding comments
anaxceron Jul 7, 2023
7b3217b
fixing syntax errors
anaxceron Jul 7, 2023
b238c59
adding description checker
anaxceron Jul 7, 2023
9a82333
adding file stuff
anaxceron Jul 7, 2023
e0015a7
testing
anaxceron Jul 7, 2023
fceba31
adding real instructions to comments
anaxceron Jul 10, 2023
ca5bdc1
troubleshooting error in comments
anaxceron Jul 10, 2023
ca1ebb5
troublehsooting
anaxceron Jul 10, 2023
b4f171a
troubleshooting
anaxceron Jul 10, 2023
eb72f4e
troubleshooting
anaxceron Jul 10, 2023
258c9a8
troubleshooting
anaxceron Jul 10, 2023
47bff3b
troubleshooting
anaxceron Jul 10, 2023
7dbac10
testing emojis
anaxceron Jul 10, 2023
390f454
trying emojis
anaxceron Jul 10, 2023
bfc9c4a
Merge branch 'master' into anax-v2.9-prinstructions-docs
anaxceron Jul 10, 2023
7e9bfcf
troubleshooting emojis
anaxceron Jul 10, 2023
c996f57
Merge branch 'anax-v2.9-prinstructions-docs' of https://github.com/zo…
anaxceron Jul 10, 2023
0e1e50f
testing comments
anaxceron Jul 10, 2023
74b51ec
testing comments
anaxceron Jul 10, 2023
bf8b953
testing line breaks
anaxceron Jul 10, 2023
7866570
testing comment instructions
anaxceron Jul 10, 2023
06f0fcc
testing lists in comments
anaxceron Jul 10, 2023
697e351
testing md in lists
anaxceron Jul 10, 2023
68cd78c
testing headers in lists
anaxceron Jul 10, 2023
b799e53
troubleshooting md in lists
anaxceron Jul 10, 2023
7cd3aea
testing md in numbered lists
anaxceron Jul 10, 2023
26e440f
testing tabs in numbered lists
anaxceron Jul 10, 2023
3401449
draft initial comment for non-writers
anaxceron Jul 10, 2023
012de1d
testing font size
anaxceron Jul 10, 2023
1525e41
testing initial comment
anaxceron Jul 10, 2023
7f971f7
updating comments
anaxceron Jul 10, 2023
b155f0a
troubleshooting new comments
anaxceron Jul 10, 2023
9a04302
troubleshooting comments again
anaxceron Jul 10, 2023
c2e7ca8
troubleshoot comments
anaxceron Jul 10, 2023
c301259
testing initial comment formatting
anaxceron Jul 10, 2023
2a15f81
testing comments
anaxceron Jul 10, 2023
73004a8
test comment formatting
anaxceron Jul 10, 2023
d3df0b3
comment formatting
anaxceron Jul 10, 2023
650cc74
comment formatting
anaxceron Jul 10, 2023
5861c7c
initial comment formatting
anaxceron Jul 10, 2023
16023b9
comment formatting
anaxceron Jul 10, 2023
a8b329a
comment formatting
anaxceron Jul 10, 2023
45ebb23
updating initial comment format
anaxceron Jul 10, 2023
07c5f3d
initial comment edits
anaxceron Jul 11, 2023
a17b00d
removing emoji from initial comment
anaxceron Jul 11, 2023
a8bdaf2
trying emoji again
anaxceron Jul 11, 2023
ac8cedd
adding emojis
anaxceron Jul 11, 2023
b3e3e58
adding more emojis
anaxceron Jul 11, 2023
0cfcf94
updating emojis
anaxceron Jul 11, 2023
971ec24
updating steps
anaxceron Jul 11, 2023
7991113
modifying intro comment steps
anaxceron Jul 11, 2023
ab00c09
tweaked initial comment steps
anaxceron Jul 11, 2023
3e35574
Signed-off-by: anaxceron <[email protected]>
anaxceron Jul 19, 2023
26e1be9
testing checkboxes
anaxceron Jul 20, 2023
ac4d5ec
checkboxes, updated instructions to include md file, updated invalid …
anaxceron Jul 20, 2023
bd4f582
updated missing-description message
anaxceron Jul 20, 2023
641f4b6
added file checker
anaxceron Aug 4, 2023
5336073
updated missing files message
anaxceron Aug 4, 2023
4fcbc68
updated emoji for file name message
anaxceron Aug 4, 2023
0c7af3e
Merge branch 'master' into anax-v2.9-prinstructions-docs
anaxceron Oct 9, 2023
73147f7
Merge pull request #2981 from zowe/anax-v2.9-prinstructions-docs
anaxceron Oct 10, 2023
2336834
Test 1
anaxceron Oct 26, 2023
051fca1
updating w/ PR instructions
anaxceron Oct 26, 2023
c27ab6f
Merge pull request #3211 from zowe/anax-test-branch-test1
anaxceron Oct 26, 2023
05dab65
non-doc-squad test
anaxceron Oct 27, 2023
fa10ce1
updating instructions
anaxceron Oct 27, 2023
92238e7
formatting for version labels
anaxceron Oct 27, 2023
18eb624
fixing typos
anaxceron Oct 27, 2023
95b4e85
adding my name back as a doc squad member
anaxceron Oct 27, 2023
5fc3ed8
updating code
anaxceron Oct 30, 2023
610828d
code update
anaxceron Oct 30, 2023
f5db029
updating desc comment
anaxceron Oct 31, 2023
41cff7c
Merge pull request #3220 from zowe/anax-test-branch-fixing-desc-comment
anaxceron Oct 31, 2023
513bf84
Add workflow for labelling issues
t1m0thyj Nov 10, 2023
038bdfc
Ignore 403 errors in link checker results
t1m0thyj Nov 10, 2023
2c189f8
Update PR checker workflow to detect labellers and delete comments
t1m0thyj Nov 10, 2023
81b1296
Use zowe-robot to update PR labels
t1m0thyj Nov 10, 2023
289d694
Use pull_request_target event to allow comments from forks
t1m0thyj Nov 10, 2023
66b51c5
updating comments; adding community member comment
anaxceron Nov 10, 2023
3d8471d
Merge pull request #3248 from zowe/anax-test-branch-updatedcomments
anaxceron Nov 10, 2023
2716dbf
updating comment line breaks
anaxceron Nov 10, 2023
44f0acf
Merge pull request #3250 from zowe/anax-test-branch-updatedcomments
anaxceron Nov 10, 2023
46dc2a1
updating comments
anaxceron Nov 10, 2023
1a2939a
Merge pull request #3252 from zowe/anax-test-branch-updatedcomments
anaxceron Nov 10, 2023
f305024
Delete "invalid PR description" comments when fixed
t1m0thyj Nov 13, 2023
9e78669
removing test text in v2.11 release notes
anaxceron Nov 27, 2023
55aecbc
Merge branch 'master' into anax-test-branch
anaxceron Nov 29, 2023
2617e96
updates per doc squad feedback
anaxceron Dec 13, 2023
28871d3
Merge branch 'master' into anax-test-branch
anaxceron Dec 13, 2023
3893a8e
adding V3 N/A label instructions
anaxceron Dec 19, 2023
59bbd1c
Merge branch 'master' of https://github.com/zowe/docs-site into anax-…
anaxceron Jan 4, 2024
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
12 changes: 12 additions & 0 deletions .github/pr-comments/for-community.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
:smiley_cat: Thank you for creating this PR!

Looks like you either do not have permissions to add labels in the `docs-site` repo, or you are using a fork in your PR. To publish your content to [Zowe Docs](https://docs.zowe.org/), follow these steps.

- [ ] Enter the `/labels` command in a comment to add required `review`, `area`, and `release` labels to your pull request.
anaxceron marked this conversation as resolved.
Show resolved Hide resolved
- 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.
- Example: Enter `/labels doc cli V2` to add the `review: doc`, `area: cli`, and `version: V2` labels to your PR.
- 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.
- [ ] 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.
9 changes: 9 additions & 0 deletions .github/pr-comments/for-labeller.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
: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 for your content. (Examples: `release: V1`, `release: V2`, `release: V3`)
anaxceron marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, for v3, it seems like a good idea to inform the PR opener to target the v3 branch. Glad we discussed this. ;-)

- [ ] 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.
9 changes: 9 additions & 0 deletions .github/pr-comments/for-writer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
: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 for your content. (Examples: `release: V1`, `release: V2`, `release: V3`)
anaxceron marked this conversation as resolved.
Show resolved Hide resolved
- [ ] 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.
Copy link
Collaborator

@janan07 janan07 Jan 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if this point is necessary or could perhaps cause someone to open a PR against a different branch than that which was used as the base branch (e.g. someone opens a new branch against docs-staging, but then targets the master branch). Maybe it would be best to say to target the branch that was used to base your PR branch.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janan07 That would be the intent -- to remind folks that the live changes use the master branch and changes for the future use the docs-staging branch. So if their base branch doesn't align w/ this, then, yep, they'd need to change their branch to align w/ our branching strategy.

13 changes: 3 additions & 10 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion .github/workflows/link-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
80 changes: 80 additions & 0 deletions .github/workflows/pr-comment-trigger.yml
Original file line number Diff line number Diff line change
@@ -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(", ") });
}
}
178 changes: 178 additions & 0 deletions .github/workflows/pull-request-checker.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
2 changes: 1 addition & 1 deletion docs/getting-started/release-notes/v2_11_0.md
Original file line number Diff line number Diff line change
@@ -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!

Expand Down
Loading