Skip to content

Commit ff31f34

Browse files
Merge branch 'production' into marcio/pcx17803-mconn-kvm
2 parents 0f24c57 + d5a19de commit ff31f34

File tree

453 files changed

+3447
-24681
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

453 files changed

+3447
-24681
lines changed

.github/workflows/comment-changed-filenames.yml renamed to .github/workflows/potential-redirects-or-partials.yml

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Flag changed filenames
1+
name: Potential redirects or partials
22

33
# **What it does**: Adds or removes a comment if a PR renames or removes a file.
44
# **Why we have it**: Highlights when we need redirects covering certain file paths.
@@ -22,7 +22,7 @@ jobs:
2222
- name: Checkout Repository
2323
uses: actions/checkout@v4
2424

25-
- name: Get Renamed or Removed Files from Pull Request
25+
- name: Potential redirects
2626
env:
2727
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2828
run: |
@@ -37,17 +37,32 @@ jobs:
3737
echo "${files}" >> "$GITHUB_ENV"
3838
echo "${delimiter}" >> "$GITHUB_ENV"
3939
40+
- name: Updated partial files
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
run: |
44+
files=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
45+
-H "Accept: application/vnd.github.v3+json" \
46+
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | \
47+
jq -r '.[] | select(.status=="modified") | select (.filename | startswith("src/content/partials")) | select(.filename | endswith(".mdx")) | .filename' | \
48+
sed -e 's|^src/content/partials||' -e 's|\.mdx$|/|')
49+
# Use random delimiter for security reasons
50+
delimiter="$(openssl rand -hex 8)"
51+
echo "PARTIAL_FILES<<${delimiter}" >> "$GITHUB_ENV"
52+
echo "${files}" >> "$GITHUB_ENV"
53+
echo "${delimiter}" >> "$GITHUB_ENV"
54+
4055
- name: Comment or Update Comment on PR based on changed files
4156
env:
4257
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4358
run: |
4459
# If there are no changed files
45-
if [ -z "$CHANGED_FILES" ]; then
60+
if [ -z "$CHANGED_FILES" ] && [ -z "$PARTIAL_FILES" ]; then
4661
# Fetch the ID of the existing comment, if it exists
4762
existing_comment_id=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
4863
-H "Accept: application/vnd.github.v3+json" \
4964
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" | \
50-
jq '.[] | select(.user.id == 41898282) | select(.body | contains("This PR changes current filenames or deletes current files")) | .id')
65+
jq '.[] | select(.user.id == 41898282) | select(.body | contains("This PR requires additional review attention because it affects the following areas")) | .id')
5166
5267
# If the comment exists, delete it
5368
if [ ! -z "$existing_comment_id" ]; then
@@ -58,18 +73,39 @@ jobs:
5873
fi
5974
else
6075
# Construct the comment body for changed files
61-
comment_body="This PR changes current filenames or deletes current files. Make sure you have [redirects](https://developers.cloudflare.com/pages/configuration/redirects/) set up to cover the following paths:"
62-
for path in $CHANGED_FILES; do
63-
clean_path=$(echo $path | sed 's/"//g') # Remove quotation marks
76+
comment_body="This PR requires additional review attention because it affects the following areas:"
77+
78+
# Add CHANGED_FILES logic
79+
if [ -n "$CHANGED_FILES" ]; then
6480
comment_body="$comment_body
81+
82+
### Redirects
83+
This PR changes current filenames or deletes current files. Make sure you have [redirects](https://developers.cloudflare.com/pages/configuration/redirects/) set up to cover the following paths:"
84+
for path in $CHANGED_FILES; do
85+
clean_path=$(echo "$path" | sed 's/"//g') # Remove quotation marks
86+
comment_body="$comment_body
6587
- [ ] \`$clean_path\`"
66-
done
88+
done
89+
fi
90+
91+
# Conditional bit for PARTIAL_FILES
92+
if [ -n "$PARTIAL_FILES" ]; then
93+
comment_body="$comment_body
94+
95+
### Partials
96+
This PR updates partial files, which are pieces of content used across multiple files in our [Render component](https://developers.cloudflare.com/style-guide/components/render/)."
97+
for path in $PARTIAL_FILES; do
98+
updated_path=$(echo "$path" | sed -e 's/"//g' -e 's/^\///' -e 's/\/$//')
99+
comment_body="$comment_body
100+
- [ ] \`$updated_path\` - [view affected files](https://developers.cloudflare.com/style-guide/components/render/?partial=$updated_path)"
101+
done
102+
fi
67103
68104
# Check if a comment already exists
69105
existing_comment_id=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
70106
-H "Accept: application/vnd.github.v3+json" \
71107
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" | \
72-
jq '.[] | select(.user.id == 41898282) | select(.body | contains("This PR changes current filenames or deletes current files")) | .id')
108+
jq '.[] | select(.user.id == 41898282) | select(.body | contains("This PR requires additional review attention because it affects the following areas")) | .id')
73109
74110
comment_payload=$(echo '{}' | jq --arg body "$comment_body" '.body = $body')
75111

.github/workflows/publish-production.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@ jobs:
4040
npx tsx bin/generate-index-md.ts
4141
cd distmd && zip -r markdown.zip .
4242
npx wrangler r2 object put vendored-markdown/markdown.zip --file=markdown.zip --remote
43+
rm markdown.zip
44+
- name: Upload vendored Markdown files to ZT DevDocs bucket
45+
env:
46+
AWS_ACCESS_KEY_ID: ${{ secrets.ZT_DEVDOCS_ACCESS_KEY_ID }}
47+
AWS_SECRET_ACCESS_KEY: ${{ secrets.ZT_DEVDOCS_SECRET_ACCESS_KEY }}
48+
run: |
49+
sudo -v ; curl https://rclone.org/install.sh | sudo bash
50+
rclone sync \
51+
--s3-env-auth \
52+
--s3-provider="Cloudflare" \
53+
--s3-endpoint="https://e76c849bd111ee7d3006b6625713991e.r2.cloudflarestorage.com" \
54+
distmd \
55+
:s3:/zt-dashboard-dev-docs
4356
- uses: actions/cache/save@v4
4457
if: always()
4558
with:

astro.config.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,21 @@ export default defineConfig({
161161
headingLinks: false,
162162
},
163163
routeMiddleware: "./src/plugins/starlight/route-data.ts",
164+
disable404Route: true,
164165
}),
165166
liveCode({}),
166167
icon(),
167168
sitemap({
168169
filter(page) {
169-
return !page.startsWith(
170-
"https://developers.cloudflare.com/style-guide/",
171-
);
170+
if (page.includes("/style-guide/")) {
171+
return false;
172+
}
173+
174+
if (page.endsWith("/404/")) {
175+
return false;
176+
}
177+
178+
return true;
172179
},
173180
serialize(item) {
174181
item.lastmod = new Date().toISOString();

ec.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import pluginDefaultTitles from "./src/plugins/expressive-code/default-titles.js
1010
import pluginGraphqlApiExplorer from "./src/plugins/expressive-code/graphql-api-explorer.js";
1111

1212
import { pluginCollapsibleSections } from "@expressive-code/plugin-collapsible-sections";
13+
import { pluginLineNumbers } from "@expressive-code/plugin-line-numbers";
1314

1415
export default defineEcConfig({
1516
plugins: [
@@ -18,7 +19,11 @@ export default defineEcConfig({
1819
pluginDefaultTitles(),
1920
pluginCollapsibleSections(),
2021
pluginGraphqlApiExplorer(),
22+
pluginLineNumbers(),
2123
],
24+
defaultProps: {
25+
showLineNumbers: false,
26+
},
2227
themes: [darkTheme, lightTheme],
2328
styleOverrides: {
2429
borderWidth: "1px",

0 commit comments

Comments
 (0)