Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding check for no issue number #8792

Merged
merged 5 commits into from
Jan 7, 2025
Merged

Conversation

markgov
Copy link
Contributor

@markgov markgov commented Dec 19, 2024

A reference to the issue / Description of it

we have found an issue with the new post comment feature that breaks the plan when the reusable workflow is called outside of a PR. Because there is no issue number we are seeing errors like the following

Error: Unhandled error: TypeError: Cannot read properties of undefined (reading 'number')

How does this PR fix the problem?

This PR adds in a check test to see if issue_number is blank if it is it just puts a comment in the console and skips to the end

How has this been tested?

Please describe the tests that you ran and provide instructions to reproduce.

{Please write here}

Deployment Plan / Instructions

Will this deployment impact the platform and / or services on it?

{Please write here}

Checklist (check x in [ ] of list items)

  • I have performed a self-review of my own code
  • All checks have passed
  • I have made corresponding changes to the documentation
  • Plan and discussed how it should be deployed to PROD (If needed)

Additional comments (if any)

{Please write here}

@markgov markgov requested a review from a team as a code owner December 19, 2024 10:26
Copy link
Contributor

Terraform Plan Summary

single-sign-on
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

Terraform Plan Summary

modernisation-platform-account
Plan: 0 to add, 1 to change, 0 to destroy.

Copy link
Contributor

Terraform Plan Summary

core-vpc-preproduction
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

Terraform Plan Summary

core-vpc-production
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

Terraform Plan Summary

core-vpc-development
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

Trivy Scan Success

Show Output ```hcl

Trivy will check the following folders:

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:

CTFLint Scan Success

Show Output
*****************************

Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version: 0.9.1)
tflint will check the following folders:

Trivy Scan Success

Show Output
*****************************

Trivy will check the following folders:

Copy link
Contributor

Terraform Plan Summary

core-security-production
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

Terraform Plan Summary

pagerduty
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

Terraform Plan Summary

core-logging-production
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

Terraform Plan Summary

core-shared-services-production
Plan: 1 to add, 1 to change, 0 to destroy.

Copy link
Contributor

Terraform Plan Summary

github
Plan: 48 to add, 0 to change, 47 to destroy.

Copy link
Contributor

Terraform Plan Summary

core-network-services-production
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

Terraform Plan Summary

github
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

Terraform Plan Summary

single-sign-on
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

Terraform Plan Summary

modernisation-platform-account
Plan: 0 to add, 2 to change, 0 to destroy.

Copy link
Contributor

Terraform Plan Summary

pagerduty
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

Terraform Plan Summary

core-vpc-production
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

Terraform Plan Summary

core-vpc-preproduction
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

Terraform Plan Summary

core-vpc-development
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

Terraform Plan Summary

core-security-production
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

Trivy Scan Success

Show Output ```hcl

Trivy will check the following folders:

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:

CTFLint Scan Success

Show Output
*****************************

Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version: 0.9.1)
tflint will check the following folders:

Trivy Scan Success

Show Output
*****************************

Trivy will check the following folders:

Copy link
Contributor

Terraform Plan Summary

core-logging-production
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

Terraform Plan Summary

core-network-services-production
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

Terraform Plan Summary

core-shared-services-production
Plan: 1 to add, 1 to change, 0 to destroy.

Copy link
Contributor

Terraform Plan Summary

github
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

modernisation-platform-account
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

pagerduty
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

core-vpc-preproduction
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

core-vpc-production
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

core-vpc-development
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Trivy Scan Success

Show Output ```hcl

Trivy will check the following folders:

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:

CTFLint Scan Success

Show Output
*****************************

Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version: 0.9.1)
tflint will check the following folders:

Trivy Scan Success

Show Output
*****************************

Trivy will check the following folders:

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

core-security-production
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

core-logging-production
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

core-network-services-production
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

core-shared-services-production
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

github
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

single-sign-on
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

modernisation-platform-account
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

pagerduty
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

core-vpc-production
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

core-vpc-development
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

core-vpc-preproduction
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

core-security-production
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Trivy Scan Success

Show Output ```hcl

Trivy will check the following folders:

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:

CTFLint Scan Success

Show Output
*****************************

Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version: 0.9.1)
tflint will check the following folders:

Trivy Scan Success

Show Output
*****************************

Trivy will check the following folders:

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

core-logging-production
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

core-shared-services-production
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

core-network-services-production
No changes. Your infrastructure matches the configuration.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Terraform Plan Summary

github
No changes. Your infrastructure matches the configuration.

@markgov
Copy link
Contributor Author

markgov commented Jan 7, 2025

I have tested this update and now when the workflow is run without an issue number it now skips adding the comment see bellow workflow run for confirmation
https://github.com/ministryofjustice/modernisation-platform/actions/runs/12649212337/job/35245131099

@markgov markgov added this pull request to the merge queue Jan 7, 2025
Merged via the queue into main with commit 36929fb Jan 7, 2025
21 checks passed
@markgov markgov deleted the feat/plan-summary-as-comment branch January 7, 2025 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants