Skip to content

Commit 8cdbeb2

Browse files
authored
Merge pull request #494 from netwrix/dev
dev to main
2 parents 4cf5421 + 93440a4 commit 8cdbeb2

9 files changed

Lines changed: 218 additions & 161 deletions

File tree

.github/workflows/claude-doc-pr.yml

Lines changed: 74 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,73 @@ jobs:
123123
echo "No Vale issues found"
124124
fi
125125
126+
- name: Run Dale linting
127+
id: dale
128+
if: steps.changed-files.outputs.count > 0
129+
uses: anthropics/claude-code-action@v1
130+
env:
131+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
132+
with:
133+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
134+
github_token: ${{ secrets.GITHUB_TOKEN }}
135+
show_full_output: true
136+
prompt: |
137+
You are Dale, a documentation linter. Your ONLY job is to check files against Dale rules and write results to a JSON file.
138+
139+
CHANGED FILES: ${{ steps.changed-files.outputs.files }}
140+
141+
INSTRUCTIONS:
142+
143+
Step 1: Read each Dale rule file:
144+
- .claude/skills/dale/rules/minimizing-difficulty.yml
145+
- .claude/skills/dale/rules/negative-assumptions.yml
146+
- .claude/skills/dale/rules/xy-slop.yml
147+
148+
Step 2: Read each changed file listed above (split on commas).
149+
150+
Step 3: For each file, check every line against each rule's "reason" field. When a line triggers a rule, record it.
151+
152+
Step 4: Write results to /tmp/dale-results.json as a JSON array. Each entry must have:
153+
- "path": the file path exactly as given above
154+
- "line": the line number (integer)
155+
- "rule": the rule filename without extension (e.g. "minimizing-difficulty")
156+
- "message": the rule's "message" field value
157+
158+
If no issues found, write an empty array: []
159+
160+
Example output:
161+
[{"path":"docs/foo/bar.md","line":7,"rule":"minimizing-difficulty","message":"Do not minimize the difficulty of tasks users are performing."}]
162+
163+
IMPORTANT: Write ONLY the JSON file. Do not post comments, do not run any other tools. Your task is done when /tmp/dale-results.json exists.
164+
claude_args: '--allowedTools "Read,Write"'
165+
166+
- name: Post Dale inline comments
167+
id: dale-post
168+
if: steps.changed-files.outputs.count > 0
169+
env:
170+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
171+
run: |
172+
DALE_COUNT=0
173+
if [ -f /tmp/dale-results.json ]; then
174+
DALE_COUNT=$(jq 'length' /tmp/dale-results.json 2>/dev/null || echo "0")
175+
fi
176+
177+
echo "dale_count=$DALE_COUNT" >> "$GITHUB_OUTPUT"
178+
179+
if [ "$DALE_COUNT" -gt 0 ]; then
180+
echo "Posting $DALE_COUNT Dale inline comments"
181+
# Transform Dale results into PR review comment format
182+
COMMENTS_JSON=$(jq '[.[] | {"path": .path, "line": .line, "body": ("**Dale** (`" + .rule + "`): " + .message)}]' /tmp/dale-results.json)
183+
jq -n \
184+
--arg body "**Dale found ${DALE_COUNT} issue(s).** See inline comments below." \
185+
--argjson comments "$COMMENTS_JSON" \
186+
'{"body": $body, "event": "COMMENT", "comments": $comments}' \
187+
| gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews \
188+
--input - 2>&1
189+
else
190+
echo "No Dale issues found"
191+
fi
192+
126193
- name: Get PR diff
127194
id: diff
128195
if: steps.changed-files.outputs.count > 0
@@ -153,6 +220,7 @@ jobs:
153220
- PR number: ${{ github.event.pull_request.number }}
154221
- Changed files: ${{ steps.changed-files.outputs.files }}
155222
- Vale issues: ${{ steps.vale.outputs.vale_count }} (already posted as inline comments)
223+
- Dale issues: ${{ steps.dale-post.outputs.dale_count }} (already posted as inline comments)
156224
- PR diff is at: /tmp/pr-diff.txt
157225
158226
INSTRUCTIONS:
@@ -163,6 +231,7 @@ jobs:
163231
- Voice: passive voice, first person, impersonal phrases
164232
- Clarity: hard-to-parse sentences, ambiguous references
165233
- Surface: wordiness, redundancy
234+
Do NOT duplicate issues already caught by Vale or Dale — focus on what linters miss.
166235
167236
Step 3: Write the review to /tmp/doc-pr-review.md with this EXACT structure:
168237
@@ -173,12 +242,12 @@ jobs:
173242
(if no issues found, write "No editorial issues found.")
174243
175244
### Summary
176-
N Vale issues (see inline comments), N editorial suggestions across N files.
245+
N Vale issues, N Dale issues (see inline comments), N editorial suggestions across N files.
177246
178247
---
179248
**What to do next:**
180249
Comment `@claude` on this PR followed by your instructions to get help:
181-
- `@claude fix all issues` — fix all Vale and editorial issues
250+
- `@claude fix all issues` — fix all Vale, Dale, and editorial issues
182251
- `@claude fix only the Vale issues` — fix just the linting problems
183252
- `@claude help improve the flow of this document` — get writing assistance
184253
> Automated fixes are only available for branches in this repository, not forks.
@@ -290,17 +359,17 @@ jobs:
290359
}
291360
}
292361
}' -f owner="$OWNER" -f name="$NAME" -F pr="$PR_NUMBER" \
293-
--jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false and (.comments.nodes[0].body | contains("**Vale**"))) | .id' 2>/dev/null || true)
362+
--jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false and ((.comments.nodes[0].body | contains("**Vale**")) or (.comments.nodes[0].body | contains("**Dale**")))) | .id' 2>/dev/null || true)
294363
for TID in $THREAD_IDS; do
295364
gh api graphql -f query='
296365
mutation($tid:ID!) {
297366
resolveReviewThread(input:{threadId:$tid}) { thread { isResolved } }
298367
}' -f tid="$TID" 2>/dev/null || true
299368
done
300369
301-
# Dismiss all previous Vale reviews
370+
# Dismiss all previous Vale and Dale reviews
302371
REVIEW_IDS=$(gh api repos/${REPO}/pulls/${PR_NUMBER}/reviews \
303-
--jq '[.[] | select(.user.login == "github-actions[bot]" and (.body | contains("Vale found"))) | .id] | .[]' 2>/dev/null || true)
372+
--jq '[.[] | select(.user.login == "github-actions[bot]" and ((.body | contains("Vale found")) or (.body | contains("Dale found")))) | .id] | .[]' 2>/dev/null || true)
304373
for ID in $REVIEW_IDS; do
305374
gh api repos/${REPO}/pulls/${PR_NUMBER}/reviews/${ID}/dismissals \
306375
-f message="Superseded after fixes applied" -f event="DISMISS" 2>/dev/null || true

docs/auditor/10.7/configuration/fileservers/netappcmode/overview.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ To configure Clustered Data ONTAP 8 and ONTAP 9 for monitoring, perform the foll
121121

122122
- Prerequisites
123123
- [Configure ONTAPI\RESTAPI Web Access](/docs/auditor/10.7/configuration/fileservers/netappcmode/webaccess.md)
124-
- [Configure System Service Firewall Policies](/docs/auditor/10.7/configuration/fileservers/netappcmode/ports.md)
125124
- [Configure Service Policy](/docs/auditor/10.7/configuration/fileservers/netappcmode/servicepolicy.md)
126125
- [Configure Event Categories and Log](/docs/auditor/10.7/configuration/fileservers/netappcmode/eventcategories.md)
127126

docs/auditor/10.7/configuration/fileservers/netappcmode/ports.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

docs/auditor/10.7/configuration/fileservers/netappcmode/servicepolicy.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ sidebar_position: 30
66

77
# Configure Service Policy
88

9-
**NOTE:** This paragraph only applies to NetApp ONTAP version 9.10.1 and higher.
9+
**NOTE:** This section only applies to NetApp ONTAP version 9.10.1 and higher.
10+
For older NetApp ONTAP versions use [System Service Firewall Policies](#configure-system-service-firewall-policies) instead.
1011

1112
By default, the 'default-data-files' policy is applied to the SVM CIFS/SMB interface and HTTP/HTTPS
1213
options are not available. To make the ONTAPI available through HTTP/HTTPS ports on your SVM
@@ -109,3 +110,46 @@ of the configuration:
109110
svm1 lif_svm1_126 netwrix-policy
110111

111112
svm1 lif_svm1_349 netwrix-policy
113+
114+
115+
## Configure System Service Firewall Policies
116+
117+
**NOTE:** This section applies to NetApp ONTAP 9.10.1 and lower. For ONTAP versions higher than 9.10.1, the `system services firewall policy` command context is deprecated.
118+
See the [NetApp ONTAP 9.10.1 CLI documentation](https://docs.netapp.com/us-en/ontap-cli-9101/system-services-firewall-policy-show.html#description) for details.
119+
120+
Configure firewall to make file shares and Clustered Data ONTAP HTTP/HTTPS ports accessible from the
121+
computer where Netwrix Auditor Server is installed. Your firewall configuration depends on network
122+
settings and security policies in your organization. Below is an example of configuration:
123+
124+
1. Navigate to your cluster command prompt through the SSH/Telnet connection.
125+
2. Log in as a cluster administrator and review your current firewall configuration. For example:
126+
127+
| | | |
128+
| ----------------------------------------- | ------------ | ------- |
129+
| cluster1::> system services firewall show | | |
130+
| Node | Enabled | Logging |
131+
| ------------ | ------------ | ------- |
132+
| cluster1-01 | true | false |
133+
134+
3. Create a firewall policy or edit an existing policy to allow HTTP/HTTPS.
135+
When modifying an existing policy, be aware that some settings may be overwritten.
136+
137+
| To... | Execute... |
138+
| ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
139+
| NetApp Clustered Data ONTAP 8.2 | |
140+
| Create a policy | `cluster1::> system services firewall policy create -policy netwrix_policy -service http -vserver svm1 -action allow -ip-list 192.168.1.0/24` `cluster1::> system services firewall policy create -policy netwrix_policy -service https -vserver svm1 -action allow -ip-list 192.168.1.0/24` |
141+
| Modify existing policy | `cluster1::> system services firewall policy modify -policy netwrix_policy -service http -vserver svm1 -action allow -ip-list 192.168.1.0/24` `cluster1::> system services firewall policy modify -policy netwrix_policy -service https -vserver svm1 -action allow -ip-list 192.168.1.0/24` |
142+
| NetApp Clustered Data ONTAP 8.3, ONTAP 9.0 - 9.10 | |
143+
| Create a policy | `cluster1::> system services firewall policy create -policy netwrix_policy -service http -vserver svm1 -allow-list 192.168.1.0/24` `cluster1::> system services firewall policy create -policy netwrix_policy -service https -vserver svm1 -allow-list 192.168.1.0/24` |
144+
| Modify existing policy | `cluster1::> system services firewall policy modify -policy netwrix_policy -service http -vserver svm1 -allow-list 192.168.1.0/24` `cluster1::> system services firewall policy modify -policy netwrix_policy -service https -vserver svm1 -allow-list 192.168.1.0/24` |
145+
146+
where `netwrix_policy` is your Firewall policy name and `192.168.1.0/24` is your subnet where Netwrix
147+
Auditor Server resides.
148+
149+
4. Apply the firewall policy to a LIF.
150+
151+
`cluster1::>network interface modify -vserver svm -lif vs1-cifs-lif1 -firewall-policy netwrix_policy`
152+
153+
To verify the policy was applied correctly, execute the following:
154+
155+
`cluster1::>network interface show -fields firewall-policy`

docs/auditor/10.8/configuration/fileservers/netappcmode/overview.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ To configure Clustered Data ONTAP 8 and ONTAP 9 for monitoring, perform the foll
121121

122122
- Prerequisites
123123
- [Configure ONTAPI\RESTAPI Web Access](/docs/auditor/10.8/configuration/fileservers/netappcmode/webaccess.md)
124-
- [Configure System Service Firewall Policies](/docs/auditor/10.8/configuration/fileservers/netappcmode/ports.md)
125124
- [Configure Service Policy](/docs/auditor/10.8/configuration/fileservers/netappcmode/servicepolicy.md)
126125
- [Configure Event Categories and Log](/docs/auditor/10.8/configuration/fileservers/netappcmode/eventcategories.md)
127126

0 commit comments

Comments
 (0)