Skip to content

Commit

Permalink
Display more information about deployment based on description
Browse files Browse the repository at this point in the history
As mentioned in [Github documentation](https://docs.github.com/en/rest/deployments/deployments#about-the-deployments-api):
> Deployment statuses can also include an optional description and log_url, which are highly recommended because they make deployment statuses more useful.

We want to avoid having duplicate information between "pipeline" and
"deployments" and use the more rich informations provided on
description.

For people who use the classic Github Action to mark deployment as suggested by Jira. It's here:

https://github.com/chrnorm/deployment-action/blob/880668c419e283adc6b1cc092d52eb5e558fec4d/action.yml#L24-L26

Related:
  - atlassian#1536
  - atlassian#1732
  - atlassian#1736
  • Loading branch information
benoittgt committed Nov 10, 2022
1 parent 930265f commit 2345f90
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/transforms/transform-deployment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const buildJiraPayload = (associations) => {
schemaVersion: "1.0",
deploymentSequenceNumber: 1234,
updateSequenceNumber: 123456,
displayName: "deploy",
displayName: "foo42",
url: "test-repo-url/commit/885bee1-commit-id-1c458/checks",
description: "deploy",
lastUpdated: new Date("2021-06-28T12:15:18.000Z"),
Expand Down
2 changes: 1 addition & 1 deletion src/transforms/transform-deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export const transformDeployment = async (githubInstallationClient: GitHubInstal
schemaVersion: "1.0",
deploymentSequenceNumber: deployment.id,
updateSequenceNumber: deployment_status.id,
displayName: deployment.task,
displayName: deployment.description || deployment_status.description,
url: deployment_status.target_url || deployment.url,
description: deployment.description || deployment_status.description || deployment.task,
lastUpdated: new Date(deployment_status.updated_at),
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/deployment_status-basic.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"login": "TestUser[bot]",
"type": "Bot"
},
"description": "",
"description": "Last deploy status desc on production",
"environment": "Production",
"target_url": "test-repo-url/commit/885bee1-commit-id-1c458/checks",
"created_at": "2021-06-28T12:15:18Z",
Expand All @@ -20,7 +20,7 @@
"task": "deploy",
"original_environment": "Production",
"environment": "Production",
"description": "",
"description": "Deploying X on production",
"created_at": "2021-06-28T12:15:18Z",
"updated_at": "2021-06-28T12:15:18Z",
"creator": {
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/deployment_status_staging.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"login": "TestUser[bot]",
"type": "Bot"
},
"description": "",
"description": "Last deploy status desc on foo42",
"environment": "foo42",
"target_url": "test-repo-url/commit/885bee1-commit-id-1c458/checks",
"created_at": "2021-06-28T12:15:18Z",
Expand All @@ -20,7 +20,7 @@
"task": "deploy",
"original_environment": "foo42",
"environment": "foo42",
"description": "",
"description": "Deploying X on foo42",
"created_at": "2021-06-28T12:15:18Z",
"updated_at": "2021-06-28T12:15:18Z",
"creator": {
Expand Down

0 comments on commit 2345f90

Please sign in to comment.