-
Notifications
You must be signed in to change notification settings - Fork 537
HDDS-11072. Publish user-facing configs to the doc site #6916
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
e63b840
d2b3d2e
0611fe2
2fbd2d4
0ab8cb1
21db9fa
e09f2ed
180adc2
9db5dcb
9a75c2b
7f974cc
d77580f
3ab2148
babafff
898afea
37ae2df
8c45500
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -211,21 +211,18 @@ jobs: | |||||
echo "Configurations.md is unchanged, skipping commit and PR creation." | ||||||
echo "hashes_differ=false" >> $GITHUB_ENV | ||||||
fi | ||||||
- name: Configure Git | ||||||
if: env.hashes_differ == 'true' | ||||||
run: | | ||||||
git config user.name "github-actions[bot]" | ||||||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||||||
- name: Commit and push changes to apache/ozone | ||||||
if: env.hashes_differ == 'true' | ||||||
run: | | ||||||
git config --global user.name 'Github Actions' | ||||||
git config --global user.email '[email protected]' | ||||||
git add hadoop-hdds/docs/content/tools/Configurations.md | ||||||
git commit -m "[Auto] Update Configurations.md from $GITHUB_SHA" | ||||||
git push origin HEAD:master | ||||||
- name: Create Pull Request in apache/ozone | ||||||
if: env.hashes_differ == 'true' | ||||||
env: | ||||||
token: ${{ secrets.GITHUB_TOKEN }} | ||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
run: | | ||||||
gh pr create --title "[Auto] Update Configurations.md" --body "This is an automated pull request." | ||||||
sarvekshayr marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
- name: Checkout ozone-site repository | ||||||
|
@@ -234,28 +231,31 @@ jobs: | |||||
with: | ||||||
repository: apache/ozone-site | ||||||
ref: 'HDDS-9225-website-v2' | ||||||
token: ${{ secrets.GITHUB_TOKEN }} | ||||||
path: ozone-site | ||||||
- name: Copy MD file to ozone-site repository | ||||||
if: env.hashes_differ == 'true' | ||||||
run: | | ||||||
TARGET_DIR=$(find ozone-site/docs -type d -name '*-administrative-guide' -exec find {} -type d -name '*-configuration' -print -quit \;) | ||||||
echo "$TARGET_DIR" | ||||||
TARGET_DIR=$(find ozone-site/docs -type d -name '*-administrator-guide' -exec find {} -type d -name '*-configuration' -print -quit \;) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need the recursive search provided by find, and it might actually be more predictable to leave it out. I think we can simplify this:
Suggested change
|
||||||
echo "Target directory: $TARGET_DIR" | ||||||
if [ -z "$TARGET_DIR" ]; then | ||||||
echo "Target directory not found." | ||||||
exit 1 | ||||||
fi | ||||||
cp hadoop-hdds/docs/content/tools/Configurations.md "$TARGET_DIR/configurations.md" | ||||||
sarvekshayr marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This page is currently called "Configuration Key Appendix" in the new website. We should name the file The number at the beginning of the name is required by the new website's CI to define an absolute ordering of pages in the sdebar. We probably want this to be the last page in the section always. We could list all the current numbers and add 1 to make it the next, but there is actually no requirement that the numbers are consecutive, they work more like weights. To keep this simple I would suggest naming this file |
||||||
- name: Commit and push changes to apache/ozone-site | ||||||
if: env.hashes_differ == 'true' | ||||||
run: | | ||||||
cd ozone-site | ||||||
git config user.name "github-actions[bot]" | ||||||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||||||
cd .. | ||||||
git add "$TARGET_DIR/configurations.md" | ||||||
git config --global user.name 'Github Actions' | ||||||
git config --global user.email 'noreply@github.com' | ||||||
ADD_FILE=$(find docs -type d -name '*-administrator-guide' -exec find {} -type d -name '*-configuration' -print -quit \;) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should save the absolute path to the file as a variable in the previous step instead of recomputing it. |
||||||
git add "$ADD_FILE/configurations.md" | ||||||
git commit -m "[Auto] Update configurations.md page from ozone $GITHUB_SHA" | ||||||
git push origin HEAD:HDDS-9225-website-v2 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar comment from before about source and target branches applies here as well. |
||||||
- name: Create Pull Request in apache/ozone-site | ||||||
if: env.hashes_differ == 'true' | ||||||
env: | ||||||
token: ${{ secrets.GITHUB_TOKEN }} | ||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
run: | | ||||||
cd ozone-site | ||||||
gh pr create --title "[Auto] Update configurations.md page" --body "This is an automated pull request from the ozone repository." | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar comment about PR description from before applies here as well. |
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is adding the commit directly to master. This should actually go to a source branch based off the latest master with a unique name. In the following PR step, we should explicitly specify the source and target branches for the PR. I think we will have to manually delete the branch when the PR is merged. I'm not sure how to do something like dependabot where the branch gets automatically deleted when the PR is merged.