@trendai-crem/claude-skills 1.5.2 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: upgrade-blackduck-scan
|
|
3
|
+
description: Use when upgrading BlackDuck scan action in GitHub Actions workflows. Triggers on requests to fix broken BlackDuck scans, upgrade blackduck-scan-actions version, or migrate from v1.x to v2.x.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Upgrade BlackDuck Scan Action
|
|
7
|
+
|
|
8
|
+
Interactive workflow for upgrading `actions/blackduck-scan-actions` in GitHub Actions workflows on `adc.github.trendmicro.com`.
|
|
9
|
+
|
|
10
|
+
## Step 1: Gather Information
|
|
11
|
+
|
|
12
|
+
Ask the user ALL of the following before making any changes:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
AskUserQuestion([
|
|
16
|
+
{ question: "Which repo(s) to upgrade? (e.g., CoreTech-SASEDL/ZTRIServer)", header: "Repo" },
|
|
17
|
+
{ question: "What is the scan workflow filename?", header: "Workflow", options: [
|
|
18
|
+
{ label: "Scan.yaml", description: ".github/workflows/Scan.yaml" },
|
|
19
|
+
{ label: "scanning.yml", description: ".github/workflows/scanning.yml" },
|
|
20
|
+
{ label: "Other", description: "I'll specify the path" }
|
|
21
|
+
]},
|
|
22
|
+
{ question: "Which base branch to create the feature branch from?", header: "Base branch", options: [
|
|
23
|
+
{ label: "develop", description: "Standard SDLC flow" },
|
|
24
|
+
{ label: "master", description: "Repos without develop branch" }
|
|
25
|
+
]},
|
|
26
|
+
{ question: "Cherry-pick to longterm branch?", header: "Longterm", options: [
|
|
27
|
+
{ label: "Yes", description: "Create separate LT branch + PR" },
|
|
28
|
+
{ label: "No", description: "No longterm branch in this repo" }
|
|
29
|
+
]}
|
|
30
|
+
])
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Step 2: Fetch Valid Versions
|
|
34
|
+
|
|
35
|
+
Query the action repo for available versions:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
GH_HOST=adc.github.trendmicro.com gh api repos/actions/blackduck-scan-actions/tags \
|
|
39
|
+
--jq '.[] | .name' | grep -E '^v[0-9]' | grep -v test | sort -V
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Present the list and ask which version to use. Recommend the latest `v2.x` tag.
|
|
43
|
+
|
|
44
|
+
**IMPORTANT**: Any `v1.x` version is broken because `detect.synopsys.com` is dead. Only `v2.x` versions work.
|
|
45
|
+
|
|
46
|
+
## Step 3: Read Current Workflow
|
|
47
|
+
|
|
48
|
+
Read the scan workflow file and identify:
|
|
49
|
+
|
|
50
|
+
1. Current action version (`@v1.2`, `@v1`, etc.)
|
|
51
|
+
2. Whether "Check BlackDuck Scan Results" custom step exists
|
|
52
|
+
3. `block` boolean casing (`True` vs `true`)
|
|
53
|
+
4. Existing `with:` parameters
|
|
54
|
+
|
|
55
|
+
Show the user what will change before editing.
|
|
56
|
+
|
|
57
|
+
## Step 4: Apply Changes
|
|
58
|
+
|
|
59
|
+
### 4a: Upgrade action version
|
|
60
|
+
```yaml
|
|
61
|
+
# BEFORE
|
|
62
|
+
uses: actions/blackduck-scan-actions@v1.2
|
|
63
|
+
|
|
64
|
+
# AFTER
|
|
65
|
+
uses: actions/blackduck-scan-actions@v2.3.8 # or user-selected version
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 4b: Add migration comment
|
|
69
|
+
```yaml
|
|
70
|
+
# v2 required: detect.synopsys.com (v1) is dead; Synopsys Detect 7 EOL March 2024
|
|
71
|
+
- name: Blackduck Scan
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 4c: Add v2 parameters after `repo_path`
|
|
75
|
+
```yaml
|
|
76
|
+
blackduck_version: '8'
|
|
77
|
+
msg_receiver: ${{ secrets.TEAMS_WEBHOOK }}
|
|
78
|
+
enable_iac_scan: 'true'
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### 4d: Fix boolean casing
|
|
82
|
+
Change `block: True` to `block: true` in the `env:` block.
|
|
83
|
+
|
|
84
|
+
### 4e: Remove "Check BlackDuck Scan Results" step
|
|
85
|
+
Delete the entire step containing `sleep 60` + `curl --insecure` + hardcoded project UUID. v2 handles exit codes natively.
|
|
86
|
+
|
|
87
|
+
### 4f: Do NOT touch
|
|
88
|
+
- `fortify-scan` job
|
|
89
|
+
- `secrets-scan` job
|
|
90
|
+
- `notify` job
|
|
91
|
+
- Any other unrelated steps
|
|
92
|
+
|
|
93
|
+
## Step 5: Commit and PR
|
|
94
|
+
|
|
95
|
+
Branch name: `RIDL-17983/upgrade-blackduck-scan-v2` (or user's JIRA ticket)
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
git add <workflow-file>
|
|
99
|
+
git commit -m "<JIRA>: fix: upgrade BlackDuck scan action from v1.x to v2
|
|
100
|
+
|
|
101
|
+
detect.synopsys.com domain is dead. Upgrade to v2.x which uses
|
|
102
|
+
detect.blackduck.com and Detect 8. Remove hardcoded results check
|
|
103
|
+
step as v2 handles exit codes natively."
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Create PR to the base branch. If longterm cherry-pick requested, create `-LT` branch and separate PR.
|
|
107
|
+
|
|
108
|
+
## Step 6: Verify (Guide for User)
|
|
109
|
+
|
|
110
|
+
After merging, guide the user through verification:
|
|
111
|
+
|
|
112
|
+
### 6a: Trigger scan
|
|
113
|
+
- Manually trigger via `workflow_dispatch` on the merged branch, OR
|
|
114
|
+
- The scan runs automatically on PR to `master`
|
|
115
|
+
|
|
116
|
+
### 6b: Check workflow logs
|
|
117
|
+
Verify in GitHub Actions:
|
|
118
|
+
- `actions/blackduck-scan-actions@v2.x` appears in "Set up job"
|
|
119
|
+
- Detect 8/9 banner is displayed
|
|
120
|
+
- Scan duration is 1-5 minutes (not 46ms)
|
|
121
|
+
- `[info] blackduck result: success` or `fail` at the end
|
|
122
|
+
|
|
123
|
+
### 6c: Check BlackDuck portal
|
|
124
|
+
- Go to https://blackduck.trendmicro.com
|
|
125
|
+
- Search for the project name
|
|
126
|
+
- Verify "Last Scan" date matches today
|
|
127
|
+
- Or check the dashboard API: `https://blackduck.trendmicro.com/api/risk-profile-dashboard?limit=25&offset=0`
|
|
128
|
+
|
|
129
|
+
### 6d: Understand the result
|
|
130
|
+
- `blackduck result: success` = scan completed, no MAJOR policy violations
|
|
131
|
+
- `blackduck result: fail` = MAJOR severity policy violations found
|
|
132
|
+
- Note: `block: true` only checks MAJOR severity. CRITICAL/BLOCKER violations are reported to the portal but do NOT block the build by default
|
|
133
|
+
- To also block on CRITICAL/BLOCKER, add: `properties: '--detect.policy.check.fail.on.severities=MAJOR,CRITICAL,BLOCKER'`
|
|
134
|
+
|
|
135
|
+
## Reference
|
|
136
|
+
|
|
137
|
+
- Action repo: https://adc.github.trendmicro.com/actions/blackduck-scan-actions
|
|
138
|
+
- Wiki: https://trendmicro.atlassian.net/wiki/spaces/CN/pages/2397209007
|
|
139
|
+
- JIRA: https://trendmicro.atlassian.net/browse/RIDL-17983
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
# Upgrade BlackDuck Scan Skill Test Plan
|
|
2
|
+
|
|
3
|
+
**Skill Version**: v1.0
|
|
4
|
+
**Date**: 2026-04-09
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. Test Strategy
|
|
9
|
+
|
|
10
|
+
The skill is a prompt-driven interactive workflow (not executable code), so testing validates **behavioral correctness** across 4 categories:
|
|
11
|
+
|
|
12
|
+
| Category | What | How |
|
|
13
|
+
|----------|------|-----|
|
|
14
|
+
| **Information Gathering** | All required inputs collected before changes | Verify AskUserQuestion prompts |
|
|
15
|
+
| **Version Handling** | Correct version fetching and recommendation | Test against real action repo tags |
|
|
16
|
+
| **Workflow Modification** | Correct YAML changes applied | Validate diffs on sample workflows |
|
|
17
|
+
| **Git & PR Operations** | Branch, commit, and PR created correctly | Verify git commands and PR format |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 2. Test Cases
|
|
22
|
+
|
|
23
|
+
### 2.1 Information Gathering (Step 1)
|
|
24
|
+
|
|
25
|
+
#### TC-INFO-01: All four questions asked before any changes
|
|
26
|
+
- **Setup**: Invoke skill with "upgrade blackduck scan for CoreTech-SASEDL/ZTRIServer"
|
|
27
|
+
- **Expected**: Skill asks ALL 4 questions (repo, workflow filename, base branch, longterm) via AskUserQuestion BEFORE reading or modifying any files
|
|
28
|
+
- **Validates**: No premature file access
|
|
29
|
+
|
|
30
|
+
#### TC-INFO-02: Custom workflow filename accepted
|
|
31
|
+
- **Setup**: Answer workflow filename question with "Other" and provide `.github/workflows/ci-scan.yml`
|
|
32
|
+
- **Expected**: Skill uses custom filename for subsequent file reads
|
|
33
|
+
- **Validates**: Non-standard workflow path handling
|
|
34
|
+
|
|
35
|
+
#### TC-INFO-03: Multiple repos accepted
|
|
36
|
+
- **Setup**: Provide 2 repos: `CoreTech-SASEDL/ZTRIServer, CoreTech-SASEDL/RIDLServer`
|
|
37
|
+
- **Expected**: Skill processes each repo sequentially with same upgrade parameters
|
|
38
|
+
- **Validates**: Multi-repo support
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
### 2.2 Version Fetching (Step 2)
|
|
43
|
+
|
|
44
|
+
#### TC-VER-01: Tags fetched from correct GH_HOST
|
|
45
|
+
- **Setup**: Run version fetch step
|
|
46
|
+
- **Expected**: Command uses `GH_HOST=adc.github.trendmicro.com` and queries `repos/actions/blackduck-scan-actions/tags`
|
|
47
|
+
- **Validates**: Correct enterprise GitHub host
|
|
48
|
+
|
|
49
|
+
#### TC-VER-02: v1.x versions flagged as broken
|
|
50
|
+
- **Setup**: Tags list includes v1.2, v1.3, v2.3.8
|
|
51
|
+
- **Expected**: Skill recommends latest v2.x, warns that v1.x is broken (detect.synopsys.com dead)
|
|
52
|
+
- **Validates**: v1 deprecation warning
|
|
53
|
+
|
|
54
|
+
#### TC-VER-03: No v2.x tags available
|
|
55
|
+
- **Setup**: Simulate tag list with only v1.x versions
|
|
56
|
+
- **Expected**: Skill warns user that no working version is available, does NOT proceed with v1.x
|
|
57
|
+
- **Validates**: Fail-safe on missing v2 tags
|
|
58
|
+
|
|
59
|
+
#### TC-VER-04: Test/pre-release tags excluded
|
|
60
|
+
- **Setup**: Tags include `v2.4.0-test`, `v2.4.0-rc1`
|
|
61
|
+
- **Expected**: Filtered out by `grep -v test`; only stable versions presented
|
|
62
|
+
- **Validates**: Tag filtering
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### 2.3 Workflow Analysis (Step 3)
|
|
67
|
+
|
|
68
|
+
#### TC-ANALYSIS-01: Detect current v1.x version
|
|
69
|
+
- **Setup**: Workflow contains `uses: actions/blackduck-scan-actions@v1.2`
|
|
70
|
+
- **Expected**: Reports current version as v1.2
|
|
71
|
+
- **Validates**: Version extraction from YAML
|
|
72
|
+
|
|
73
|
+
#### TC-ANALYSIS-02: Detect "Check BlackDuck Scan Results" step
|
|
74
|
+
- **Setup**: Workflow contains step with `sleep 60` + `curl --insecure` + hardcoded UUID
|
|
75
|
+
- **Expected**: Skill identifies this step and marks it for removal
|
|
76
|
+
- **Validates**: Legacy step detection
|
|
77
|
+
|
|
78
|
+
#### TC-ANALYSIS-03: No legacy check step present
|
|
79
|
+
- **Setup**: Workflow has blackduck-scan-actions but no "Check BlackDuck Scan Results" step
|
|
80
|
+
- **Expected**: Skill proceeds without attempting removal, no error
|
|
81
|
+
- **Validates**: Graceful handling of already-clean workflows
|
|
82
|
+
|
|
83
|
+
#### TC-ANALYSIS-04: Detect boolean casing issue
|
|
84
|
+
- **Setup**: Workflow `env:` block contains `block: True` (capital T)
|
|
85
|
+
- **Expected**: Identified and flagged for fix to lowercase `true`
|
|
86
|
+
- **Validates**: Boolean casing detection
|
|
87
|
+
|
|
88
|
+
#### TC-ANALYSIS-05: Show diff preview before applying
|
|
89
|
+
- **Setup**: Any workflow file
|
|
90
|
+
- **Expected**: Skill presents a summary of planned changes to user BEFORE editing
|
|
91
|
+
- **Validates**: User confirmation before destructive changes
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### 2.4 Workflow Modification (Step 4)
|
|
96
|
+
|
|
97
|
+
#### TC-MOD-01: Action version upgraded
|
|
98
|
+
- **Setup**: Workflow with `@v1.2`
|
|
99
|
+
- **Expected**: Changed to `@v2.3.8` (or user-selected version)
|
|
100
|
+
- **Validates**: Version string replacement
|
|
101
|
+
|
|
102
|
+
#### TC-MOD-02: Migration comment added
|
|
103
|
+
- **Setup**: Workflow without migration comment
|
|
104
|
+
- **Expected**: Comment `# v2 required: detect.synopsys.com (v1) is dead; Synopsys Detect 7 EOL March 2024` added above the scan step
|
|
105
|
+
- **Validates**: Migration documentation
|
|
106
|
+
|
|
107
|
+
#### TC-MOD-03: v2 parameters added
|
|
108
|
+
- **Setup**: Workflow with only `repo_path` in `with:` block
|
|
109
|
+
- **Expected**: Three new parameters added after `repo_path`:
|
|
110
|
+
```yaml
|
|
111
|
+
blackduck_version: '8'
|
|
112
|
+
msg_receiver: ${{ secrets.TEAMS_WEBHOOK }}
|
|
113
|
+
enable_iac_scan: 'true'
|
|
114
|
+
```
|
|
115
|
+
- **Validates**: v2-specific parameter injection
|
|
116
|
+
|
|
117
|
+
#### TC-MOD-04: v2 parameters NOT duplicated
|
|
118
|
+
- **Setup**: Workflow already has `blackduck_version: '8'` from a partial previous upgrade
|
|
119
|
+
- **Expected**: Skill detects existing parameter and does NOT add duplicate
|
|
120
|
+
- **Validates**: Idempotency
|
|
121
|
+
|
|
122
|
+
#### TC-MOD-05: Boolean casing fixed
|
|
123
|
+
- **Setup**: `env:` block has `block: True`
|
|
124
|
+
- **Expected**: Changed to `block: true`
|
|
125
|
+
- **Validates**: YAML boolean normalization
|
|
126
|
+
|
|
127
|
+
#### TC-MOD-06: Legacy check step removed
|
|
128
|
+
- **Setup**: Workflow with "Check BlackDuck Scan Results" step (sleep + curl + UUID)
|
|
129
|
+
- **Expected**: Entire step removed cleanly, no orphaned YAML
|
|
130
|
+
- **Validates**: Step deletion
|
|
131
|
+
|
|
132
|
+
#### TC-MOD-07: Unrelated jobs untouched
|
|
133
|
+
- **Setup**: Workflow with `fortify-scan`, `secrets-scan`, `notify` jobs
|
|
134
|
+
- **Expected**: These jobs remain exactly as-is, byte-for-byte identical
|
|
135
|
+
- **Validates**: Blast radius control
|
|
136
|
+
|
|
137
|
+
#### TC-MOD-08: YAML structure preserved
|
|
138
|
+
- **Setup**: Workflow with specific indentation (2-space or 4-space)
|
|
139
|
+
- **Expected**: Modified YAML preserves original indentation style
|
|
140
|
+
- **Validates**: No formatting drift
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
### 2.5 Git & PR Operations (Step 5)
|
|
145
|
+
|
|
146
|
+
#### TC-GIT-01: Feature branch created from correct base
|
|
147
|
+
- **Setup**: User selects `develop` as base branch
|
|
148
|
+
- **Expected**: Branch created from `develop`, not `master` or `main`
|
|
149
|
+
- **Validates**: Base branch selection
|
|
150
|
+
|
|
151
|
+
#### TC-GIT-02: Branch naming convention
|
|
152
|
+
- **Setup**: JIRA ticket is RIDL-17983
|
|
153
|
+
- **Expected**: Branch name follows pattern `RIDL-17983/upgrade-blackduck-scan-v2`
|
|
154
|
+
- **Validates**: Naming convention
|
|
155
|
+
|
|
156
|
+
#### TC-GIT-03: Commit message format
|
|
157
|
+
- **Setup**: Standard upgrade
|
|
158
|
+
- **Expected**: Commit message includes JIRA prefix, `fix:` type, explains why (detect.synopsys.com dead), mentions v2
|
|
159
|
+
- **Validates**: Commit convention compliance
|
|
160
|
+
|
|
161
|
+
#### TC-GIT-04: PR created to correct base branch
|
|
162
|
+
- **Setup**: User selected `develop` as base
|
|
163
|
+
- **Expected**: PR targets `develop`, not `master`
|
|
164
|
+
- **Validates**: PR target branch
|
|
165
|
+
|
|
166
|
+
#### TC-GIT-05: Longterm cherry-pick creates separate PR
|
|
167
|
+
- **Setup**: User selects "Yes" for longterm cherry-pick
|
|
168
|
+
- **Expected**: Separate `-LT` branch created, second PR opened targeting longterm branch
|
|
169
|
+
- **Validates**: Longterm workflow
|
|
170
|
+
|
|
171
|
+
#### TC-GIT-06: Only workflow file committed
|
|
172
|
+
- **Setup**: Standard upgrade
|
|
173
|
+
- **Expected**: `git add` only includes the scan workflow file, no other files staged
|
|
174
|
+
- **Validates**: No accidental file inclusion
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
### 2.6 Verification Guidance (Step 6)
|
|
179
|
+
|
|
180
|
+
#### TC-VERIFY-01: Post-merge verification checklist provided
|
|
181
|
+
- **Setup**: Complete upgrade flow
|
|
182
|
+
- **Expected**: Skill provides actionable checklist: trigger scan, check logs for Detect 8/9 banner, check BlackDuck portal, understand success/fail meanings
|
|
183
|
+
- **Validates**: User guidance completeness
|
|
184
|
+
|
|
185
|
+
#### TC-VERIFY-02: Success/fail interpretation explained
|
|
186
|
+
- **Setup**: Complete upgrade flow
|
|
187
|
+
- **Expected**: Explains that `success` = no MAJOR violations, `fail` = MAJOR violations found, and that CRITICAL/BLOCKER are reported but don't block by default
|
|
188
|
+
- **Validates**: Correct result interpretation
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
### 2.7 Edge Cases
|
|
193
|
+
|
|
194
|
+
#### TC-EDGE-01: Repo not accessible
|
|
195
|
+
- **Setup**: Provide a repo the user doesn't have access to
|
|
196
|
+
- **Expected**: Skill reports access error clearly, does not proceed
|
|
197
|
+
- **Validates**: Permission error handling
|
|
198
|
+
|
|
199
|
+
#### TC-EDGE-02: Workflow file not found
|
|
200
|
+
- **Setup**: Specify a workflow filename that doesn't exist in the repo
|
|
201
|
+
- **Expected**: Skill reports file not found, asks user to verify path
|
|
202
|
+
- **Validates**: Missing file handling
|
|
203
|
+
|
|
204
|
+
#### TC-EDGE-03: Already on v2.x
|
|
205
|
+
- **Setup**: Workflow already uses `@v2.3.8`
|
|
206
|
+
- **Expected**: Skill detects no upgrade needed, reports current version, asks user if they still want to proceed
|
|
207
|
+
- **Validates**: No-op detection
|
|
208
|
+
|
|
209
|
+
#### TC-EDGE-04: Non-standard YAML structure
|
|
210
|
+
- **Setup**: Workflow with unusual structure (e.g., anchors, multi-document, complex matrix)
|
|
211
|
+
- **Expected**: Skill modifies only the blackduck-scan step, does not corrupt YAML anchors or matrix definitions
|
|
212
|
+
- **Validates**: YAML compatibility
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## 3. Test Fixtures
|
|
217
|
+
|
|
218
|
+
### Fixture A: `standard-scan.yml` (Typical v1 workflow)
|
|
219
|
+
```yaml
|
|
220
|
+
name: Scan
|
|
221
|
+
on:
|
|
222
|
+
workflow_dispatch:
|
|
223
|
+
pull_request:
|
|
224
|
+
branches: [master]
|
|
225
|
+
|
|
226
|
+
jobs:
|
|
227
|
+
blackduck-scan:
|
|
228
|
+
runs-on: [self-hosted, linux]
|
|
229
|
+
steps:
|
|
230
|
+
- uses: actions/checkout@v3
|
|
231
|
+
- name: Blackduck Scan
|
|
232
|
+
uses: actions/blackduck-scan-actions@v1.2
|
|
233
|
+
with:
|
|
234
|
+
repo_path: ${{ github.workspace }}
|
|
235
|
+
env:
|
|
236
|
+
BLACKDUCK_URL: ${{ secrets.BLACKDUCK_URL }}
|
|
237
|
+
BLACKDUCK_TOKEN: ${{ secrets.BLACKDUCK_TOKEN }}
|
|
238
|
+
block: True
|
|
239
|
+
|
|
240
|
+
- name: Check BlackDuck Scan Results
|
|
241
|
+
run: |
|
|
242
|
+
sleep 60
|
|
243
|
+
curl --insecure -X GET "https://blackduck.trendmicro.com/api/projects/abc-123/versions" \
|
|
244
|
+
-H "Authorization: Bearer ${{ secrets.BLACKDUCK_TOKEN }}"
|
|
245
|
+
|
|
246
|
+
fortify-scan:
|
|
247
|
+
runs-on: [self-hosted, linux]
|
|
248
|
+
steps:
|
|
249
|
+
- uses: actions/checkout@v3
|
|
250
|
+
- name: Fortify Scan
|
|
251
|
+
uses: actions/fortify-scan@v1
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Fixture B: `clean-v2-scan.yml` (Already upgraded)
|
|
255
|
+
```yaml
|
|
256
|
+
name: Scan
|
|
257
|
+
on:
|
|
258
|
+
workflow_dispatch:
|
|
259
|
+
|
|
260
|
+
jobs:
|
|
261
|
+
blackduck-scan:
|
|
262
|
+
runs-on: [self-hosted, linux]
|
|
263
|
+
steps:
|
|
264
|
+
- uses: actions/checkout@v3
|
|
265
|
+
- name: Blackduck Scan
|
|
266
|
+
uses: actions/blackduck-scan-actions@v2.3.8
|
|
267
|
+
with:
|
|
268
|
+
repo_path: ${{ github.workspace }}
|
|
269
|
+
blackduck_version: '8'
|
|
270
|
+
msg_receiver: ${{ secrets.TEAMS_WEBHOOK }}
|
|
271
|
+
enable_iac_scan: 'true'
|
|
272
|
+
env:
|
|
273
|
+
BLACKDUCK_URL: ${{ secrets.BLACKDUCK_URL }}
|
|
274
|
+
BLACKDUCK_TOKEN: ${{ secrets.BLACKDUCK_TOKEN }}
|
|
275
|
+
block: true
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### Fixture C: `minimal-scan.yml` (No legacy check step)
|
|
279
|
+
```yaml
|
|
280
|
+
name: Scan
|
|
281
|
+
on:
|
|
282
|
+
push:
|
|
283
|
+
branches: [develop]
|
|
284
|
+
|
|
285
|
+
jobs:
|
|
286
|
+
blackduck-scan:
|
|
287
|
+
runs-on: [self-hosted, linux]
|
|
288
|
+
steps:
|
|
289
|
+
- uses: actions/checkout@v3
|
|
290
|
+
- name: Blackduck Scan
|
|
291
|
+
uses: actions/blackduck-scan-actions@v1
|
|
292
|
+
with:
|
|
293
|
+
repo_path: ${{ github.workspace }}
|
|
294
|
+
env:
|
|
295
|
+
BLACKDUCK_URL: ${{ secrets.BLACKDUCK_URL }}
|
|
296
|
+
BLACKDUCK_TOKEN: ${{ secrets.BLACKDUCK_TOKEN }}
|
|
297
|
+
block: true
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## 4. Execution Protocol
|
|
303
|
+
|
|
304
|
+
### Phase 1: Smoke Test
|
|
305
|
+
Run the skill against Fixture A with standard inputs (single repo, Scan.yaml, develop, no longterm). Verify:
|
|
306
|
+
- All 4 questions asked upfront
|
|
307
|
+
- Version list fetched successfully
|
|
308
|
+
- Diff preview shown before changes
|
|
309
|
+
- All modifications applied correctly
|
|
310
|
+
- PR created successfully
|
|
311
|
+
|
|
312
|
+
### Phase 2: Modification Tests
|
|
313
|
+
Run TC-MOD-01 through TC-MOD-08 using Fixture A. These validate the core transformation logic.
|
|
314
|
+
|
|
315
|
+
### Phase 3: Edge Case Tests
|
|
316
|
+
Run TC-EDGE-01 through TC-EDGE-04 to verify error handling and boundary conditions.
|
|
317
|
+
|
|
318
|
+
### Phase 4: Multi-Repo and Longterm
|
|
319
|
+
Run TC-INFO-03 and TC-GIT-05 to verify multi-repo and longterm cherry-pick workflows.
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
## 5. Pass/Fail Criteria
|
|
324
|
+
|
|
325
|
+
| Category | Tests | Required Pass Rate |
|
|
326
|
+
|----------|-------|--------------------|
|
|
327
|
+
| Information Gathering (TC-INFO-*) | 3 | 3/3 (100%) |
|
|
328
|
+
| Version Fetching (TC-VER-*) | 4 | 4/4 (100%) |
|
|
329
|
+
| Workflow Analysis (TC-ANALYSIS-*) | 5 | 5/5 (100%) |
|
|
330
|
+
| Workflow Modification (TC-MOD-*) | 8 | 7/8 (allow 1 edge case) |
|
|
331
|
+
| Git & PR (TC-GIT-*) | 6 | 6/6 (100%) |
|
|
332
|
+
| Verification (TC-VERIFY-*) | 2 | 2/2 (100%) |
|
|
333
|
+
| Edge Cases (TC-EDGE-*) | 4 | 3/4 (allow 1 edge case) |
|
|
334
|
+
|
|
335
|
+
**Overall**: Information Gathering, Version Fetching, Analysis, Git & PR, and Verification categories are non-negotiable (100% pass required). Modification and Edge Case categories allow 1 failure.
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
## 6. Known Limitations (Not Tested)
|
|
340
|
+
|
|
341
|
+
- **Enterprise GitHub auth**: Assumes `GH_HOST` and `gh` CLI are pre-configured with valid credentials
|
|
342
|
+
- **YAML parser edge cases**: Complex YAML features (anchors, merge keys) may not be handled by all edit approaches
|
|
343
|
+
- **BlackDuck portal verification**: Step 6 verification is manual; no automated portal API validation
|
|
344
|
+
- **Rate limiting**: No test for GitHub API rate limits when fetching tags
|
|
345
|
+
- **Concurrent upgrades**: No test for upgrading the same repo simultaneously from multiple sessions
|