Skip to content

Commit 8419645

Browse files
authored
Merge branch 'master' into terraform-cloudngfw
2 parents 57541d6 + 185033e commit 8419645

File tree

1,543 files changed

+331681
-24498
lines changed

Some content is hidden

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

1,543 files changed

+331681
-24498
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
analyze:
99
if: github.repository_owner == 'PaloAltoNetworks'
1010
name: Analyze
11-
runs-on: pan-dev-runner
11+
runs-on: ubuntu-latest
1212
permissions:
1313
contents: read
1414
security-events: write

.github/workflows/deploy-live.yml

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,23 @@ jobs:
4444
- name: Install dependencies
4545
run: yarn --prefer-offline
4646

47+
# needed for fetching Hashicorp blog feed
48+
- name: Install Playwright
49+
run: |
50+
npx playwright install chromium
51+
npx playwright install-deps chromium
52+
53+
- name: Cache Playwright
54+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
55+
with:
56+
path: |
57+
~/.cache/ms-playwright
58+
key: ${{ runner.os }}-playwright-${{ hashFiles('package.json') }}
59+
restore-keys: |
60+
${{ runner.os }}-playwright-
61+
4762
- name: Build site
48-
run: REACT_APP_ERROR_REPORTER_APIKEY=${{ secrets.ERROR_REPORTER_APIKEY }} REACT_APP_FIREBASE_APIKEY=${{ secrets.FIREBASE_APIKEY }} REACT_APP_RECAPTCHA_APIKEY=${{ secrets.RECAPTCHA_APIKEY }} yarn build-github && zip -r build.zip build
63+
run: REACT_APP_ERROR_REPORTER_APIKEY=${{ secrets.ERROR_REPORTER_APIKEY }} REACT_APP_FIREBASE_APIKEY=${{ secrets.FIREBASE_APIKEY }} REACT_APP_RECAPTCHA_APIKEY=${{ secrets.RECAPTCHA_APIKEY }} FEED_SOFT_FAIL=1 FEED_DEBUG=1 yarn build-github && zip -r build.zip build
4964

5065
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
5166
with:
@@ -56,6 +71,8 @@ jobs:
5671
name: Deploy
5772
needs: build
5873
runs-on: pan-dev-runner-lg
74+
permissions:
75+
id-token: write
5976

6077
steps:
6178
- name: Checkout repository
@@ -74,12 +91,26 @@ jobs:
7491
- name: Unzip build artifact
7592
run: unzip build.zip
7693

94+
- name: Authenticate to Google Cloud
95+
id: auth
96+
uses: google-github-actions/auth@b7593ed2efd1c1617e1b0254da33b86225adb2a5
97+
with:
98+
workload_identity_provider: ${{ secrets.WIF_PROVIDER }}
99+
service_account: ${{ secrets.WIF_SERVICE_ACCOUNT }}
100+
101+
- name: Export Google Cloud Credentials
102+
run: echo "GCP_SA_KEY=$(cat ${{ steps.auth.outputs.credentials_file_path }})" >> $GITHUB_ENV
103+
104+
- uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4
105+
with:
106+
name: build
107+
77108
- name: Deploy to Firebase
78109
id: deploy_live
79-
uses: FirebaseExtended/action-hosting-deploy@120e124148ab7016bec2374e5050f15051255ba2 # v0.7.1
110+
uses: FirebaseExtended/action-hosting-deploy@e2eda2e106cfa35cdbcf4ac9ddaf6c4756df2c8c # v0.10.0
80111
with:
81112
repoToken: '${{ secrets.GITHUB_TOKEN }}'
82-
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_PAN_DEV_F1B58 }}'
113+
firebaseServiceAccount: "${{ env.GCP_SA_KEY }}"
83114
projectId: pan-dev-f1b58
84115
channelId: live
85116
env:

.github/workflows/deploy-preview.yml

Lines changed: 58 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,37 @@ on:
66

77
jobs:
88
precheck:
9+
if: ${{ github.repository == 'PaloAltoNetworks/pan.dev' }}
910
name: Precheck
1011
runs-on: ubuntu-latest
1112
permissions:
1213
contents: read
13-
security-events: write
1414
outputs:
1515
is-org-member-result: ${{ steps.is-org-member.outputs.is-org-member-result }}
1616
steps:
1717
- name: Check if actor is org member
1818
id: is-org-member
1919
run: |
2020
if [[ "${{ github.actor }}" == "create-pr-on-fork-for-pan-dev[bot]" ]]; then
21-
echo "is-org-member-result=null" >> "$GITHUB_OUTPUT"
21+
echo "is-org-member-result=true" >> "$GITHUB_OUTPUT"
22+
exit 0
23+
fi
24+
25+
status=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $GH_TOKEN" \
26+
https://api.github.com/orgs/PaloAltoNetworks/members/${{ github.actor }})
27+
if [ "$status" = "204" ]; then
28+
echo "is-org-member-result=true" >> "$GITHUB_OUTPUT"
2229
else
23-
echo "is-org-member-result=$(gh api -X GET orgs/PaloAltoNetworks/memberships/${{ github.actor }} | jq -r .message)" >> "$GITHUB_OUTPUT"
30+
echo "is-org-member-result=false" >> "$GITHUB_OUTPUT"
2431
fi
25-
env:
26-
GH_TOKEN: ${{ secrets.READ_ORG_PAT }}
32+
env:
33+
GH_TOKEN: ${{ secrets.READ_ORG_PAT }}
2734

2835
analyze:
29-
if: github.repository_owner == 'PaloAltoNetworks' && needs.precheck.outputs.is-org-member-result == 'null'
36+
if: github.repository == 'PaloAltoNetworks/pan.dev' && needs.precheck.outputs.is-org-member-result == 'true'
3037
name: Analyze
3138
needs: precheck
32-
runs-on: pan-dev-runner
39+
runs-on: ubuntu-latest
3340
permissions:
3441
contents: read
3542
security-events: write
@@ -54,10 +61,10 @@ jobs:
5461
uses: github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3
5562

5663
analyze_unsafe:
57-
if: github.repository_owner == 'PaloAltoNetworks' && needs.precheck.outputs.is-org-member-result != 'null'
64+
if: github.repository == 'PaloAltoNetworks/pan.dev' && needs.precheck.outputs.is-org-member-result == 'false'
5865
name: Analyze Unsafe
5966
needs: precheck
60-
runs-on: pan-dev-runner
67+
runs-on: ubuntu-latest
6168
environment: default
6269
permissions:
6370
contents: read
@@ -86,7 +93,8 @@ jobs:
8693
name: Build
8794
needs: [analyze, analyze_unsafe]
8895
if: |
89-
!failure() && !cancelled() &&
96+
github.repository == 'PaloAltoNetworks/pan.dev' &&
97+
!failure() && !cancelled() &&
9098
(success('analyze') || success('analyze_unsafe'))
9199
runs-on: pan-dev-runner-xl
92100
permissions:
@@ -108,22 +116,6 @@ jobs:
108116
id: yarn-cache
109117
run: echo "YARN_CACHE_DIR=$(yarn cache dir)" >> "${GITHUB_OUTPUT}"
110118

111-
# - name: Cache dependencies
112-
# uses: actions/cache@v4
113-
# with:
114-
# path: ${{ steps.yarn-cache.outputs.YARN_CACHE_DIR }}
115-
# key: ${{ runner.os }}-pandev-${{ hashFiles('**/yarn.lock') }}
116-
# restore-keys: |
117-
# ${{ runner.os }}-pandev-
118-
119-
# - name: Cache docusaurus build
120-
# uses: actions/cache@v4
121-
# with:
122-
# path: node_modules/.cache/webpack
123-
# key: ${{ runner.os }}-pandev-pr-${{ github.event.number }}-${{ hashFiles('**/yarn.lock') }}
124-
# restore-keys: |
125-
# ${{ runner.os }}-pandev-pr-${{ github.event.number }}-
126-
127119
- name: Install dependencies
128120
run: yarn --prefer-offline
129121

@@ -132,9 +124,9 @@ jobs:
132124
run: |
133125
echo "Including 'netsec' in build..."
134126
if [[ -n "$PRODUCTS_INCLUDE" ]]; then
135-
echo "PRODUCTS_INCLUDE=$PRODUCTS_INCLUDE,cdss,threat-vault,dns-security,iot,expedition,cloudngfw,cdl,panos,terraform,ansible,splunk,aiops-ngfw-bpa,email-dlp,dlp,ai-runtime-security" >> $GITHUB_ENV
127+
echo "PRODUCTS_INCLUDE=$PRODUCTS_INCLUDE,cdss,threat-vault,dns-security,iot,expedition,cloudngfw,cdl,panos,terraform,ansible,splunk,aiops-ngfw-bpa,email-dlp,dlp,prisma-airs" >> $GITHUB_ENV
136128
else
137-
echo "PRODUCTS_INCLUDE=cdss,threat-vault,dns-security,iot,expedition,cloudngfw,cdl,panos,terraform,ansible,splunk,aiops-ngfw-bpa,email-dlp,dlp,ai-runtime-security" >> $GITHUB_ENV
129+
echo "PRODUCTS_INCLUDE=cdss,threat-vault,dns-security,iot,expedition,cloudngfw,cdl,panos,terraform,ansible,splunk,aiops-ngfw-bpa,email-dlp,dlp,prisma-airs" >> $GITHUB_ENV
138130
fi
139131
140132
- name: Include cloud
@@ -171,8 +163,23 @@ jobs:
171163
run: |
172164
echo "Building the following products: $PRODUCTS_INCLUDE"
173165
166+
# needed for fetching Hashicorp blog feed
167+
- name: Install Playwright
168+
run: |
169+
npx playwright install chromium
170+
npx playwright install-deps chromium
171+
172+
- name: Cache Playwright
173+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
174+
with:
175+
path: |
176+
~/.cache/ms-playwright
177+
key: ${{ runner.os }}-playwright-${{ hashFiles('package.json') }}
178+
restore-keys: |
179+
${{ runner.os }}-playwright-
180+
174181
- name: Build site
175-
run: yarn build-github
182+
run: FEED_SOFT_FAIL=1 FEED_DEBUG=1 yarn build-github
176183

177184
- name: Zip build directory
178185
run: |
@@ -196,8 +203,13 @@ jobs:
196203
deploy:
197204
name: Deploy
198205
needs: build
199-
if: ${{ !failure() && !cancelled() }}
206+
if: ${{ github.repository == 'PaloAltoNetworks/pan.dev' && !failure() && !cancelled() }}
200207
runs-on: pan-dev-runner-lg
208+
permissions:
209+
contents: read
210+
pull-requests: write
211+
checks: write
212+
id-token: write
201213

202214
steps:
203215
- name: Checkout repository
@@ -227,12 +239,26 @@ jobs:
227239
echo "Deploy directory found at: $DEPLOY_DIR"
228240
echo "DEPLOY_DIR=$DEPLOY_DIR" >> $GITHUB_ENV
229241
242+
- name: Authenticate to Google Cloud
243+
id: auth
244+
uses: google-github-actions/auth@b7593ed2efd1c1617e1b0254da33b86225adb2a5
245+
with:
246+
workload_identity_provider: ${{ secrets.WIF_PROVIDER }}
247+
service_account: ${{ secrets.WIF_SERVICE_ACCOUNT }}
248+
249+
- name: Export Google Cloud Credentials
250+
run: echo "GCP_SA_KEY=$(cat ${{ steps.auth.outputs.credentials_file_path }})" >> $GITHUB_ENV
251+
252+
- uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4
253+
with:
254+
name: build
255+
230256
- name: Deploy to Firebase
231257
id: deploy_preview
232-
uses: FirebaseExtended/action-hosting-deploy@120e124148ab7016bec2374e5050f15051255ba2 # v0.7.1
258+
uses: FirebaseExtended/action-hosting-deploy@e2eda2e106cfa35cdbcf4ac9ddaf6c4756df2c8c # v0.10.0
233259
with:
234260
repoToken: '${{ secrets.GITHUB_TOKEN }}'
235-
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_PAN_DEV_F1B58 }}'
261+
firebaseServiceAccount: "${{ env.GCP_SA_KEY }}"
236262
projectId: pan-dev-f1b58
237263
expires: 30d
238264
channelId: 'pr${{ github.event.number }}'

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ products/**/versions.json
3030
# downloaded feeds/blogs
3131
src/**/blogs.json
3232
src/**/feeds.json
33+
34+
# playwright
35+
.playwright-storage.json
36+
.pw-user-data/

.gitlab-ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: docker.art.code.pan.run/build-tools--image-node:16.ep1
1+
image: docker.art.code.pan.run/build-tools--image-node:cee4eae3
22

33
cache:
44
paths:
@@ -14,7 +14,7 @@ pages:
1414
- echo "$GL_PAGES_URL"
1515
- echo "$GL_PAGES_BASE_URL"
1616
- yarn install
17-
- yarn run build
17+
- yarn run build-github
1818
- mv build public
1919
artifacts:
2020
paths:
@@ -33,7 +33,7 @@ pages:
3333
stage: 📦 publish
3434
script:
3535
- yarn install
36-
- yarn run build
36+
- yarn run build-github
3737
- mv build public
3838
artifacts:
3939
paths:

AGENTS.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# AGENTS.md
2+
3+
> **Audience** – Automated coding assistants (OpenAI Codex, Sourcegraph AMP, Windsurf, etc.). Humans are welcome to read it too!
4+
5+
---
6+
7+
## 🚀 Quick Facts
8+
9+
| Key | Value |
10+
| -------------------- | ----------------------------------------------------------------------------------------------- |
11+
| **Site** | **pan.dev** – public developer documentation for Palo Alto Networks |
12+
| **Generator** | Docusaurus **3.8.1** (static site) |
13+
| **Tooling** | Node 20 LTS (see `.nvmrc`) |
14+
| **Selective builds** | `PRODUCTS_INCLUDE` env‑var lets you build one or more products instead of the whole site (≈1 h) |
15+
16+
---
17+
18+
## 🗺️ Repository Map (top‑level)
19+
20+
| Path | Purpose |
21+
| ---------------- | ----------------------------------------------------------------------- |
22+
| `products/` | One folder per product → MDX docs, MD docs, `sidebars.{js,ts}` |
23+
| `src/pages/` | Homepage & other global landing pages – **agents SHOULD improve these** |
24+
| `src/` | Shared React + TS components, theme overrides, utilities |
25+
| `static/` | Assets copied verbatim to the final build |
26+
| `plugin-*` | Custom Docusaurus plugins (`plugin-sitemap-coveo`, GTM, etc.) |
27+
| `scripts/` | Automation helpers (e.g., `openapi-to-mdx.ts`) |
28+
| `openapi-specs/` | Raw OpenAPI JSON/YAML files fed into docusaurus-plugin-openapi-docs |
29+
| `.github/` | Workflows (self‑hosted runners, preview deploys) |
30+
31+
> **Gotcha** – Some products share a sidebar. If you omit one of those products from `PRODUCTS_INCLUDE`, the build will throw an “Unknown sidebar” error. When unsure, include the whole family (e.g., `sase,access,sdwan,scm`) or base the build command on the package.json scripts.
32+
33+
---
34+
35+
## 🛠️ Local Dev Cheat‑Sheet
36+
37+
```bash
38+
# Install deps (Node 20 LTS)
39+
yarn
40+
41+
# Full dev (slow)
42+
yarn start
43+
44+
# Fast dev – only selected products
45+
PRODUCTS_INCLUDE=contributing yarn start
46+
47+
# Format
48+
yarn format
49+
50+
# Production build (for testing and development)
51+
PRODUCTS_INCLUDE=contributing,prisma-airs yarn build-github
52+
```
53+
54+
---
55+
56+
## ✍️ Writing & Coding Guidelines
57+
58+
| ✅ **DO** | ❌ **AVOID** |
59+
| -------------------------------------------------------------------- | --------------------------------------- |
60+
| Use plain English; define acronyms on first use | Security‑jargon overload |
61+
| Add front‑matter: `id`, `title`, `sidebar_label`, `sidebar_position` | Missing or duplicate `id`s |
62+
| Keep headings hierarchical (H2 → H3 → H4) | Skipping heading levels |
63+
| Provide runnable examples (`curl`, `python`, `golang`) | Proprietary/internal endpoints |
64+
| Run `yarn format` (Prettier) before every commit | Inconsistent spacing or 100+‑char lines |
65+
| Add **alt text** for images (a11y) | Decorative images without alt text |
66+
67+
### Front‑end Conventions
68+
69+
* React functional components in **TypeScript strict mode** (see `tsconfig.json`).
70+
* Style with CSS Modules.
71+
* Theme import paths use the `@theme/` alias.
72+
* Site import paths use the `@site/` alias.
73+
74+
---
75+
76+
## 🤖 Common Agent Tasks
77+
78+
1. **Generate product documentation based on input from human.** - update/add MDX or MD files, update sidebars, test with selective build, etc.
79+
2. **Improve landing pages** – edit/update and improve pages under `src/pages`.
80+
3. **Fix issues** - open a PR with proposed fix(es) after thoroughly reviewing a Github issue.
81+
82+
> Always open a PR —even for small fixes. GitHub Actions deploys a preview to Firebase for human review.
83+
84+
---
85+
86+
## 🔒 Safety & Compliance
87+
88+
* **NO SECRETS** – never commit API keys, internal hostnames, or proprietary code.
89+
* Repo is public; content must stay customer‑friendly & vendor‑neutral.
90+
* Aim for WCAG AA accessibility (semantic HTML, good contrast, alt text).
91+
92+
---
93+
94+
## 📚 Further Reading
95+
96+
* [`README.md`](./README.md) – project overview
97+
* [`CONTRIBUTING.md`](./CONTRIBUTING.md) – full contribution guide
98+
* Docusaurus docs → [https://docusaurus.io/docs](https://docusaurus.io/docs)
99+
* Docusaurus OpenAPI Docs plugin → [https://docusaurus-openapi.tryingpan.dev](https://docusaurus-openapi.tryingpan.dev)
100+
101+
---
102+
103+
*Last updated: **2025‑07‑23***

0 commit comments

Comments
 (0)