Skip to content

patch: Swap Trivy for Grype in CI pipeline#157

Merged
johncollinson2001 merged 6 commits intomainfrom
johnc/swap-trivy-for-grype
Apr 13, 2026
Merged

patch: Swap Trivy for Grype in CI pipeline#157
johncollinson2001 merged 6 commits intomainfrom
johnc/swap-trivy-for-grype

Conversation

@johncollinson2001
Copy link
Copy Markdown
Contributor

@johncollinson2001 johncollinson2001 commented Mar 30, 2026

Description

Swap Trivy for Grype in CI pipeline.

Due to a recent update to Azure/ARM, this PR also introduces required fixes to the backup intervals supported by the module. These changes are required for the CI build to complete successfully.

Type of change

Please check the relevant options:

🔲 New feature (a change which adds functionality)
🔲 Bug fix (a change which fixes an issue)
🔲 Refactoring (code cleanup or optimisation)
🔲 Testing (new tests, or improvements to existing tests)
✅ Pipelines (changes to pipelines and workflows)
🔲 Documentation (changes to documentation)
🔲 Other (something that's not listed here - please explain)

Checklist

Please check the relevant options:

✅ My code aligns with the style of this project
🔲 I have added comments in hard to understand areas
🔲 I have added tests that prove my change works
🔲 I have updated the documentation
✅ If merging into main, I'm aware that the PR should be squash merged with a commit message that adheres to the semantic release format

Additional Information

n/a

Copilot AI review requested due to automatic review settings March 30, 2026 13:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Swaps the CI vulnerability scanner from Trivy to Grype in the GitHub Actions CI pipeline, with optional workflow-dispatch inputs for controlling the Grype install version/source.

Changes:

  • Add workflow_dispatch inputs for grype_version and grype_commit_sha.
  • Replace Trivy installation and filesystem scan steps with Grype install + scan.
  • Minor YAML formatting/whitespace cleanup in the workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci-pipeline.yaml
Comment thread .github/workflows/ci-pipeline.yaml
Comment thread .github/workflows/ci-pipeline.yaml
Copilot AI review requested due to automatic review settings March 31, 2026 13:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/end-to-end-tests/postgresql_flexible_server_backup_test.go
Comment thread tests/end-to-end-tests/managed_disk_backup_test.go
Comment thread tests/end-to-end-tests/blob_storage_backup_test.go
…tgreSQL flexible servers to align with new frequency requirements
Comment thread .github/workflows/ci-pipeline.yaml
Comment thread tests/integration-tests/backup_modules_blob_storage.tftest.hcl
…ob storage, managed disks, and PostgreSQL flexible servers
Copilot AI review requested due to automatic review settings April 13, 2026 07:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • tests/integration-tests/.terraform.lock.hcl: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread infrastructure/variables.tf Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 13, 2026 09:24
@khurram-rafiq khurram-rafiq self-requested a review April 13, 2026 09:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.

Files not reviewed (1)
  • tests/integration-tests/.terraform.lock.hcl: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +11 to +14
backup_interval_timestamp_pattern = "[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(Z|[+-][0-9]{2}:[0-9]{2})"
blob_storage_interval_pattern = "^R/${local.backup_interval_timestamp_pattern}/(${join("|", local.valid_blob_storage_intervals)})$"
managed_disk_interval_pattern = "^R/${local.backup_interval_timestamp_pattern}/(${join("|", local.valid_managed_disk_intervals)})$"
postgresql_interval_pattern = "^R/${local.backup_interval_timestamp_pattern}/(${join("|", local.valid_postgresql_flexible_server_intervals)})$"
for interval in v.backup_intervals : can(regex(local.blob_storage_interval_pattern, interval))
])
])
error_message = "Invalid backup interval for blob storage: allowed frequencies are P1D (daily) or P1W (weekly). See https://learn.microsoft.com/en-us/azure/backup/blob-backup-configure-manage for details."
for interval in v.backup_intervals : can(regex(local.managed_disk_interval_pattern, interval))
])
])
error_message = "Invalid backup interval for managed disk: allowed frequencies are PT1H, PT2H, PT4H, PT6H, PT8H, PT12H (hourly) or P1D (daily). See https://learn.microsoft.com/en-us/azure/backup/disk-backup-support-matrix for details."
for interval in v.backup_intervals : can(regex(local.postgresql_interval_pattern, interval))
])
])
error_message = "Invalid backup interval for PostgreSQL flexible server: only P1W (weekly) is allowed. See https://learn.microsoft.com/en-us/azure/backup/backup-azure-database-postgresql-flex-support-matrix for details."
@johncollinson2001 johncollinson2001 enabled auto-merge (squash) April 13, 2026 09:30
@johncollinson2001 johncollinson2001 merged commit b404ee8 into main Apr 13, 2026
7 checks passed
@johncollinson2001 johncollinson2001 deleted the johnc/swap-trivy-for-grype branch April 13, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants