Skip to content

Commit afb4e46

Browse files
Remove targeted product and sq compat from create rel ticket action (#49)
1 parent c496b61 commit afb4e46

File tree

6 files changed

+9
-79
lines changed

6 files changed

+9
-79
lines changed

.github/workflows/cloud-security-automated-release.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ on:
5353
description: "Did any rule properties change in this release"
5454
required: true
5555
type: string
56-
sq-compatibility:
57-
description: "SonarQube compatibility"
58-
required: true
59-
type: string
6056
branch:
6157
description: "Branch from which to do the release"
6258
required: true
@@ -124,7 +120,7 @@ jobs:
124120
run: |
125121
echo "::error::Rule metadata changes detected. The generated PR needs to be merged first before continuing with the release."
126122
echo "::error::Pull Request URL: ${{ steps.update-rule-metadata.outputs.pull-request-url }}"
127-
echo "::error::Please merge the PR and restart this workflow."
123+
echo "::error::Please merge the PR and run this workflow again (Start a new run instead of re-runing failed jobs in the current one)."
128124
exit 1
129125
130126
prepare-release:
@@ -175,7 +171,6 @@ jobs:
175171
with:
176172
project-name: ${{ inputs.project-name }}
177173
short-description: ${{ inputs.short-description }}
178-
sq-compatibility: ${{ inputs.sq-compatibility }}
179174
rule-props-changed: ${{ inputs.rule-props-changed }}
180175
jira-release-url: ${{ needs.prepare-release.outputs.jira-release-url }}
181176
start-progress: true
@@ -372,5 +367,12 @@ jobs:
372367
373368
if [[ "$ALL_SUCCESS" == "true" ]]; then
374369
echo "" >> $GITHUB_STEP_SUMMARY
375-
echo "PS: Don't forget to review and merge the bump version, SQS and SQC PRs!" >> $GITHUB_STEP_SUMMARY
370+
echo "PS: Don't forget to review and merge the bump version, SQS and SQC!" >> $GITHUB_STEP_SUMMARY
371+
echo "You should also update the relevant integration ticket statuses (don't forget to set the SQS ticket fix versions!)" >> $GITHUB_STEP_SUMMARY
372+
echo "For more information please check the release instructions at:" >> $GITHUB_STEP_SUMMARY
373+
echo "https://xtranet-sonarsource.atlassian.net/wiki/spaces/CSD/pages/4325048388/Release+Instructions+-+Cloud+Security" >> $GITHUB_STEP_SUMMARY
374+
else
375+
echo "" >> $GITHUB_STEP_SUMMARY
376+
echo "For fixes to common issues and other useful information please check the release instructions at:" >> $GITHUB_STEP_SUMMARY
377+
echo "https://xtranet-sonarsource.atlassian.net/wiki/spaces/CSD/pages/4325048388/Release+Instructions+-+Cloud+Security" >> $GITHUB_STEP_SUMMARY
376378
fi

.github/workflows/test-create-jira-release-ticket.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ jobs:
6161
project-name: "Test Project"
6262
version: "1.0.0"
6363
short-description: "Test release for integration testing"
64-
sq-compatibility: "2025.1"
6564
use-jira-sandbox: true
6665
continue-on-error: true
6766

@@ -101,7 +100,6 @@ jobs:
101100
project-name: "Test Project"
102101
version: "1.0.0"
103102
short-description: "Test release"
104-
sq-compatibility: "2025.1"
105103
jira-release-url: "https://test.jira.com/release/notes"
106104
continue-on-error: true
107105

@@ -124,7 +122,6 @@ jobs:
124122
project-name: "Test Project"
125123
version: "1.0.0"
126124
short-description: "Test release"
127-
sq-compatibility: "2025.1"
128125
continue-on-error: true
129126

130127
- name: Verify Missing Release URL Failure
@@ -147,7 +144,6 @@ jobs:
147144
project-name: "Test Project"
148145
version: "1.0.0"
149146
short-description: "Test release"
150-
sq-compatibility: "2025.1"
151147
jira-release-url: "https://test.jira.com/release/notes"
152148
continue-on-error: true
153149

@@ -173,7 +169,6 @@ jobs:
173169
project-name: "Test Project"
174170
version: "1.0.0"
175171
short-description: "Test release"
176-
sq-compatibility: "2025.1"
177172
continue-on-error: true
178173

179174
- name: Verify Release URL Environment Variable Works
@@ -198,7 +193,6 @@ jobs:
198193
project-name: "Test Project"
199194
version: "1.0.0"
200195
short-description: "Test release"
201-
sq-compatibility: "2025.1"
202196
jira-release-url: "https://input.jira.com/release"
203197
continue-on-error: true
204198

create-jira-release-ticket/README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ This action depends on:
2525
|------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|---------|
2626
| `project-name` | The display name of the project (e.g., SonarIaC). Used as the prefix for the release ticket summary | Yes | - |
2727
| `short-description` | A short description for the release | Yes | - |
28-
| `sq-compatibility` | SonarQube compatibility version (e.g., 2025.3) | Yes | - |
2928
| `jira-project-key` | The key of the Jira project (e.g., SONARIAC). Can also be set via `JIRA_PROJECT_KEY` environment variable | No* | - |
3029
| `version` | The version being released (e.g., 11.44.2), or leave empty to use the release version | No | - |
31-
| `targeted-product` | The targeted product version (e.g., 11.0) | No | - |
3230
| `use-jira-sandbox` | Use the sandbox server instead of the production Jira. Can also be controlled via `USE_JIRA_SANDBOX` environment variable | No | `false` |
3331
| `documentation-status` | Status of the documentation | No | `N/A` |
3432
| `rule-props-changed` | Whether rule properties have changed (`Yes` or `No`) | No | `No` |
@@ -65,7 +63,6 @@ This action depends on:
6563
project-name: 'SonarIaC'
6664
version: '11.44.2'
6765
short-description: 'Bug fixes and performance improvements'
68-
sq-compatibility: '2025.3'
6966
jira-release-url: 'https://sonarsource.atlassian.net/projects/SONARIAC/versions/12345'
7067

7168
- name: Use created ticket
@@ -85,8 +82,6 @@ This action depends on:
8582
with:
8683
project-name: 'SonarIaC'
8784
short-description: 'Major release with new features'
88-
sq-compatibility: '2025.3'
89-
targeted-product: '11.0'
9085
rule-props-changed: 'Yes'
9186
```
9287
@@ -98,7 +93,6 @@ This action depends on:
9893
with:
9994
project-name: 'Test Project'
10095
short-description: 'Beta release for testing'
101-
sq-compatibility: '2025.3'
10296
use-jira-sandbox: 'true'
10397
```
10498
@@ -110,7 +104,6 @@ This action depends on:
110104
with:
111105
project-name: 'SonarIaC'
112106
short-description: 'Quarterly release'
113-
sq-compatibility: '2025.3'
114107
start-progress: 'true'
115108
```
116109
@@ -123,7 +116,6 @@ This action depends on:
123116
jira-project-key: 'SONARIAC'
124117
project-name: 'SonarIaC'
125118
short-description: 'Release with environment variable usage'
126-
sq-compatibility: '2025.3'
127119
jira-release-url: 'https://sonarsource.atlassian.net/projects/SONARIAC/versions/12345'
128120

129121
- name: Post to Slack
@@ -156,8 +148,6 @@ The action populates the following Jira custom fields:
156148
| Field | Custom Field ID | Source Input |
157149
|-------------------------|-------------------|------------------------|
158150
| Short Description | customfield_10146 | `short-description` |
159-
| SonarQube Compatibility | customfield_10148 | `sq-compatibility` |
160-
| Targeted Product | customfield_10163 | `targeted-product` |
161151
| Link to Release Notes | customfield_10145 | `jira-release-url` |
162152
| Documentation Status | customfield_10147 | `documentation-status` |
163153
| Rule Properties Changed | customfield_11263 | `rule-props-changed` |

create-jira-release-ticket/action.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,8 @@ inputs:
99
short-description:
1010
description: 'A short description for the release'
1111
required: true
12-
sq-compatibility:
13-
description: 'SonarQube compatibility version (e.g., 2025.3)'
14-
required: true
1512
jira-project-key:
1613
description: 'The key of the project (e.g., SONARIAC). Required if JIRA_PROJECT_KEY env var is not set.'
17-
targeted-product:
18-
description: 'The targeted product version (e.g., 11.0)'
1914
version:
2015
description: 'The version being released (e.g., 11.44.2), or leave empty to use the release version.'
2116
use-jira-sandbox:
@@ -93,8 +88,6 @@ runs:
9388
--project-name="${{ inputs.project-name }}" \
9489
--version="${{ inputs.version || env.RELEASE_VERSION }}" \
9590
--short-description="${{ inputs.short-description }}" \
96-
--targeted-product="${{ inputs.targeted-product }}" \
97-
--sq-compatibility="${{ inputs.sq-compatibility }}" \
9891
--jira-url="${{ ((inputs.use-jira-sandbox || env.USE_JIRA_SANDBOX) == 'true') && env.JIRA_SANDBOX_URL || env.JIRA_PROD_URL }}" \
9992
--documentation-status="${{ inputs.documentation-status }}" \
10093
--rule-props-changed="${{ inputs.rule-props-changed }}" \

create-jira-release-ticket/create_release_ticket.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
CUSTOM_FIELDS = {
1515
'SHORT_DESCRIPTION': 'customfield_10146',
16-
'SQ_COMPATIBILITY': 'customfield_10148',
17-
'TARGETED_PRODUCT': 'customfield_10163',
1816
'LINK_TO_RELEASE_NOTES': 'customfield_10145',
1917
'DOCUMENTATION_STATUS': 'customfield_10147',
2018
'RULE_PROPS_CHANGED': 'customfield_11263',
@@ -75,16 +73,12 @@ def create_release_ticket(jira_client, args, link_to_release_notes):
7573
'issuetype': 'Ask for release',
7674
'summary': f'{args.project_name} {args.version}',
7775
CUSTOM_FIELDS['SHORT_DESCRIPTION']: args.short_description,
78-
CUSTOM_FIELDS['SQ_COMPATIBILITY']: args.sq_compatibility,
7976
CUSTOM_FIELDS['LINK_TO_RELEASE_NOTES']: link_to_release_notes,
8077
CUSTOM_FIELDS['DOCUMENTATION_STATUS']: args.documentation_status,
8178
CUSTOM_FIELDS['RULE_PROPS_CHANGED']: {'value': args.rule_props_changed},
8279
CUSTOM_FIELDS['SONARLINT_CHANGELOG']: args.sonarlint_changelog
8380
}
8481

85-
if args.targeted_product:
86-
ticket_details[CUSTOM_FIELDS['TARGETED_PRODUCT']] = {'value': args.targeted_product}
87-
8882
try:
8983
new_ticket = jira_client.create_issue(fields=ticket_details)
9084
return new_ticket
@@ -107,8 +101,6 @@ def main():
107101
parser.add_argument("--project-name", required=True, help="The display name of the project (e.g., SonarIaC).")
108102
parser.add_argument("--version", required=True, help="The version being released (e.g., 11.44.2).")
109103
parser.add_argument("--short-description", required=True, help="A short description for the release.")
110-
parser.add_argument("--sq-compatibility", required=True, help="SonarQube compatibility version (e.g., 2025.3).")
111-
parser.add_argument("--targeted-product", help="The targeted product version (e.g., 11.0).")
112104
parser.add_argument("--jira-url", required=True, help="The Jira server URL to connect to.")
113105
parser.add_argument("--documentation-status", default="N/A", help="Status of the documentation.")
114106
parser.add_argument("--rule-props-changed", default="No", choices=['Yes', 'No'],

create-jira-release-ticket/test_create_release_ticket.py

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,9 @@ def test_create_release_ticket_with_all_fields(self):
6969
args.project_name = 'TestProject'
7070
args.version = '1.2.3'
7171
args.short_description = 'Test release'
72-
args.sq_compatibility = '2025.1'
7372
args.documentation_status = 'Ready'
7473
args.rule_props_changed = 'Yes'
7574
args.sonarlint_changelog = 'Test changelog'
76-
args.targeted_product = '11.0'
7775

7876
release_url = 'https://jira.com/release/notes'
7977

@@ -88,42 +86,10 @@ def test_create_release_ticket_with_all_fields(self):
8886
self.assertEqual(call_args['issuetype'], 'Ask for release')
8987
self.assertEqual(call_args['summary'], 'TestProject 1.2.3')
9088
self.assertEqual(call_args['customfield_10146'], 'Test release') # SHORT_DESCRIPTION
91-
self.assertEqual(call_args['customfield_10148'], '2025.1') # SQ_COMPATIBILITY
9289
self.assertEqual(call_args['customfield_10145'], release_url) # LINK_TO_RELEASE_NOTES
9390
self.assertEqual(call_args['customfield_10147'], 'Ready') # DOCUMENTATION_STATUS
9491
self.assertEqual(call_args['customfield_11263'], {'value': 'Yes'}) # RULE_PROPS_CHANGED
9592
self.assertEqual(call_args['customfield_11264'], 'Test changelog') # SONARLINT_CHANGELOG
96-
self.assertEqual(call_args['customfield_10163'], {'value': '11.0'}) # TARGETED_PRODUCT
97-
98-
def test_create_release_ticket_without_optional_fields(self):
99-
"""Test creating release ticket without optional fields."""
100-
mock_jira = Mock()
101-
mock_ticket = Mock()
102-
mock_ticket.key = 'REL-124'
103-
mock_ticket.permalink.return_value = 'https://jira.com/REL-124'
104-
mock_jira.create_issue.return_value = mock_ticket
105-
106-
# Mock args
107-
args = Mock()
108-
args.project_name = 'TestProject'
109-
args.version = '1.2.3'
110-
args.short_description = 'Test release'
111-
args.sq_compatibility = '2025.1'
112-
args.documentation_status = 'N/A'
113-
args.rule_props_changed = 'No'
114-
args.sonarlint_changelog = ''
115-
args.targeted_product = None
116-
117-
release_url = 'https://jira.com/release/notes'
118-
119-
result = create_release_ticket(mock_jira, args, release_url)
120-
121-
self.assertEqual(result, mock_ticket)
122-
mock_jira.create_issue.assert_called_once()
123-
124-
# Verify the issue creation call - should not include targeted_product
125-
call_args = mock_jira.create_issue.call_args[1]['fields']
126-
self.assertNotIn('customfield_10163', call_args) # TARGETED_PRODUCT should not be set
12793

12894
# noinspection DuplicatedCode,PyUnusedLocal
12995
@patch('create_release_ticket.eprint')
@@ -138,11 +104,9 @@ def test_create_release_ticket_jira_error(self, mock_eprint):
138104
args.project_name = 'TestProject'
139105
args.version = '1.2.3'
140106
args.short_description = 'Test release'
141-
args.sq_compatibility = '2025.1'
142107
args.documentation_status = 'N/A'
143108
args.rule_props_changed = 'No'
144109
args.sonarlint_changelog = ''
145-
args.targeted_product = None
146110

147111
with self.assertRaises(SystemExit) as cm:
148112
create_release_ticket(mock_jira, args, 'https://release.url')
@@ -155,7 +119,6 @@ def test_create_release_ticket_jira_error(self, mock_eprint):
155119
'--project-name', 'Test Project',
156120
'--version', '1.0.0',
157121
'--short-description', 'Test release',
158-
'--sq-compatibility', '2025.1',
159122
'--jira-url', 'https://test.jira.com',
160123
'--jira-release-url', 'https://jira.com/release/notes'
161124
])
@@ -200,8 +163,6 @@ def test_main_successful_ticket_creation(self, mock_stderr, mock_stdout, mock_cr
200163
'--project-name', 'Test Project',
201164
'--version', '1.0.0',
202165
'--short-description', 'Test release',
203-
'--sq-compatibility', '2025.1',
204-
'--targeted-product', '11.0',
205166
'--jira-url', 'https://sandbox.jira.com',
206167
'--jira-release-url', 'https://sandbox.jira.com/release/notes',
207168
'--documentation-status', 'Ready',
@@ -235,8 +196,6 @@ def test_main_with_all_parameters(self, mock_stderr, mock_stdout, mock_create_ti
235196
self.assertEqual(args.project_name, 'Test Project')
236197
self.assertEqual(args.version, '1.0.0')
237198
self.assertEqual(args.short_description, 'Test release')
238-
self.assertEqual(args.sq_compatibility, '2025.1')
239-
self.assertEqual(args.targeted_product, '11.0')
240199
self.assertEqual(args.jira_url, 'https://sandbox.jira.com')
241200
self.assertEqual(args.jira_release_url, 'https://sandbox.jira.com/release/notes')
242201
self.assertEqual(args.documentation_status, 'Ready')

0 commit comments

Comments
 (0)