Skip to content

Commit 75c8ea2

Browse files
GHA-212 Fix CI tests for get-jira-release-notes after JET taxonomy migration (#115)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 69548c4 commit 75c8ea2

3 files changed

Lines changed: 3 additions & 143 deletions

File tree

.github/workflows/test-get-jira-release-notes.yml

Lines changed: 0 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -266,140 +266,3 @@ jobs:
266266
echo "✅ Jira Release Notes correctly exclude Feature category"
267267
fi
268268
269-
test-default-issue-categories-deprecated-taxonomy:
270-
name: Test Action Integration with Default Issue Categories on project with deprecated Jira taxonomy
271-
runs-on: ubuntu-latest
272-
permissions:
273-
contents: read
274-
id-token: write
275-
steps:
276-
- name: Checkout code
277-
uses: actions/checkout@v4
278-
279-
- name: Get release notes from a sandbox project
280-
id: test-sandbox
281-
uses: ./get-jira-release-notes
282-
with:
283-
jira-project-key: 'SONARPHP'
284-
jira-version-name: '3.49'
285-
use-jira-sandbox: 'true'
286-
287-
- name: Output results
288-
run: |
289-
echo "Jira Release URL: ${{ steps.test-sandbox.outputs.jira-release-url }}"
290-
echo "Jira Release Issue Filter URL: ${{ steps.test-sandbox.outputs.jira-release-issue-filter-url }}"
291-
echo "Release Notes:"
292-
echo "${{ steps.test-sandbox.outputs.release-notes }}"
293-
echo "Jira Release Notes:"
294-
echo "${{ steps.test-sandbox.outputs.jira-release-notes }}"
295-
296-
- name: Verify Jira Release URL
297-
run: |
298-
if [[ "${{ steps.test-sandbox.outputs.jira-release-url }}" != https://sonarsource-sandbox-608.atlassian.net/projects/SONARPHP/versions/*/tab/release-report-all-issues ]]; then
299-
echo "❌ Jira Release URL format is incorrect"
300-
exit 1
301-
else
302-
echo "✅ Jira Release URL format is correct"
303-
fi
304-
305-
- name: Verify Jira Release Issue Filter URL
306-
run: |
307-
if [[ "${{ steps.test-sandbox.outputs.jira-release-issue-filter-url }}" != https://sonarsource-sandbox-608.atlassian.net/issues/?jql=fixVersion%3D22169 ]]; then
308-
echo "❌ Jira Release Issue Filter URL is incorrect"
309-
echo "Expected: https://sonarsource-sandbox-608.atlassian.net/issues/?jql=fixVersion%3D22169"
310-
echo "Got: ${{ steps.test-sandbox.outputs.jira-release-issue-filter-url }}"
311-
exit 1
312-
else
313-
echo "✅ Jira Release Issue Filter URL is correct"
314-
fi
315-
316-
- name: Verify Release Notes Content
317-
run: |
318-
if grep -q "### Improvement" <<< "${{ steps.test-sandbox.outputs.release-notes }}"; then
319-
echo "✅ Release Notes contain default issue categories"
320-
else
321-
echo "❌ Release Notes are missing some default issue categories"
322-
exit 1
323-
fi
324-
325-
if grep -q "### Task" <<< "${{ steps.test-sandbox.outputs.release-notes }}"; then
326-
echo "❌ Release Notes should not contain Task category with default settings"
327-
exit 1
328-
else
329-
echo "✅ Release Notes correctly exclude Task category"
330-
fi
331-
332-
- name: Verify Jira Release Notes Content
333-
run: |
334-
if grep -q "h3. Improvement" <<< "${{ steps.test-sandbox.outputs.jira-release-notes }}"; then
335-
echo "✅ Jira Release Notes contain default issue category"
336-
else
337-
echo "❌ Jira Release Notes are missing some default issue categories"
338-
exit 1
339-
fi
340-
341-
if grep -q "h3. Task" <<< "${{ steps.test-sandbox.outputs.jira-release-notes }}"; then
342-
echo "❌ Jira Release Notes should not contain Task category with default settings"
343-
exit 1
344-
else
345-
echo "✅ Jira Release Notes correctly exclude Task category"
346-
fi
347-
348-
test-custom-issue-categories-deprecated-taxonomy:
349-
name: Test Action Integration with Custom Issue Categories on project with deprecated Jira taxonomy
350-
runs-on: ubuntu-latest
351-
permissions:
352-
contents: read
353-
id-token: write
354-
steps:
355-
- name: Checkout code
356-
uses: actions/checkout@v4
357-
358-
- name: Get release notes from a sandbox project with custom issue types
359-
id: test-sandbox-custom
360-
uses: ./get-jira-release-notes
361-
with:
362-
jira-project-key: 'SONARPHP'
363-
jira-version-name: '3.49'
364-
use-jira-sandbox: 'true'
365-
issue-types: 'Task,Bug,New Feature'
366-
367-
- name: Output results
368-
run: |
369-
echo "Jira Release URL: ${{ steps.test-sandbox-custom.outputs.jira-release-url }}"
370-
echo "Release Notes:"
371-
echo "${{ steps.test-sandbox-custom.outputs.release-notes }}"
372-
echo "Jira Release Notes:"
373-
echo "${{ steps.test-sandbox-custom.outputs.jira-release-notes }}"
374-
375-
- name: Verify Release Notes Content
376-
run: |
377-
if grep -q "### Task" <<< "${{ steps.test-sandbox-custom.outputs.release-notes }}"; then
378-
echo "✅ Release Notes contain Task category as specified"
379-
else
380-
echo "❌ Release Notes are missing Task category"
381-
exit 1
382-
fi
383-
384-
if grep -q "### Improvement" <<< "${{ steps.test-sandbox-custom.outputs.release-notes }}"; then
385-
echo "❌ Release Notes should not contain Improvement category with custom settings"
386-
exit 1
387-
else
388-
echo "✅ Release Notes correctly exclude Improvement category"
389-
fi
390-
391-
- name: Verify Jira Release Notes Content
392-
run: |
393-
if grep -q "h3. Task" <<< "${{ steps.test-sandbox-custom.outputs.jira-release-notes }}"; then
394-
echo "✅ Jira Release Notes contain Task category as specified"
395-
else
396-
echo "❌ Jira Release Notes are missing Task category"
397-
exit 1
398-
fi
399-
400-
if grep -q "h3. Improvement" <<< "${{ steps.test-sandbox-custom.outputs.jira-release-notes }}"; then
401-
echo "❌ Jira Release Notes should not contain Improvement category with custom settings"
402-
exit 1
403-
else
404-
echo "✅ Jira Release Notes correctly exclude Improvement category"
405-
fi

get-jira-release-notes/get_jira_release_notes.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,11 @@ def main():
171171
else:
172172
category_order = [
173173
"Feature",
174-
# Added for backwards compatibility of old Jira taxonomy
175-
"New Feature",
176174
"False Positive",
177175
"False Negative",
178176
"Bug",
179-
# Added for backwards compatibility of old Jira taxonomy
180-
"Improvement",
181-
"Security"
177+
"Security",
178+
"Maintenance"
182179
]
183180
eprint(f"Using default issue type order: {category_order}")
184181

get-jira-release-notes/test_get_jira_release_notes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def test_main_default_issue_types(self, mock_stderr, mock_get_jira):
338338

339339
# Verify stderr shows default issue types
340340
stderr_output = mock_stderr.getvalue()
341-
expected_default = ["Feature", "New Feature", "False Positive", "False Negative", "Bug", "Improvement", "Security"]
341+
expected_default = ["Feature", "False Positive", "False Negative", "Bug", "Security", "Maintenance"]
342342
self.assertIn(f"Using default issue type order: {expected_default}", stderr_output)
343343

344344
@patch('sys.argv', [

0 commit comments

Comments
 (0)