From 76f57852a906e67d2cbee6f609a4c6bca153b853 Mon Sep 17 00:00:00 2001 From: Karishma Chawla Date: Mon, 5 Feb 2024 12:14:35 -0800 Subject: [PATCH 1/3] Use unique resource names in test Terraform Recipe (#7108) # Description Trying a fix for https://github.com/radius-project/radius/issues/7060. Resource name uniqueness is tied to resource group right now, potentially causing concurrency issues. ## Type of change - This pull request fixes a bug in Radius and has an approved issue (issue link required). - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: https://github.com/radius-project/radius/issues/7060 Signed-off-by: karishma-chawla <74574173+karishma-chawla@users.noreply.github.com> Co-authored-by: karishma-chawla <74574173+karishma-chawla@users.noreply.github.com> --- .../corerp-resources-terraform-azurestorage.bicep | 1 - .../test-terraform-recipes/azure-storage/main.tf | 10 +++++++--- .../test-terraform-recipes/azure-storage/variables.tf | 4 ---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/test/functional/shared/resources/testdata/corerp-resources-terraform-azurestorage.bicep b/test/functional/shared/resources/testdata/corerp-resources-terraform-azurestorage.bicep index edd8140e00..e560de7606 100644 --- a/test/functional/shared/resources/testdata/corerp-resources-terraform-azurestorage.bicep +++ b/test/functional/shared/resources/testdata/corerp-resources-terraform-azurestorage.bicep @@ -27,7 +27,6 @@ resource env 'Applications.Core/environments@2023-10-01-preview' = { templateKind: 'terraform' templatePath: '${moduleServer}/azure-storage.zip' parameters: { - name: 'blob${uniqueString(resourceGroup().id)}' resource_group_name: resourceGroup().name location: location } diff --git a/test/functional/shared/resources/testdata/recipes/test-terraform-recipes/azure-storage/main.tf b/test/functional/shared/resources/testdata/recipes/test-terraform-recipes/azure-storage/main.tf index 7f6e0aeda1..8655f5fa5d 100644 --- a/test/functional/shared/resources/testdata/recipes/test-terraform-recipes/azure-storage/main.tf +++ b/test/functional/shared/resources/testdata/recipes/test-terraform-recipes/azure-storage/main.tf @@ -7,8 +7,12 @@ terraform { } } +resource "random_id" "unique_name" { + byte_length = 8 +} + resource "azurerm_storage_account" "test_storage_account" { - name = var.name + name = "acct${random_id.unique_name.hex}" resource_group_name = var.resource_group_name location = var.location account_tier = "Standard" @@ -16,12 +20,12 @@ resource "azurerm_storage_account" "test_storage_account" { } resource "azurerm_storage_container" "test_container" { - name = "test-container" + name = "ctr${random_id.unique_name.hex}" storage_account_name = azurerm_storage_account.test_storage_account.name } resource "azurerm_storage_blob" "test_blob" { - name = "test-blob" + name = "blob${random_id.unique_name.hex}" storage_account_name = azurerm_storage_account.test_storage_account.name storage_container_name = azurerm_storage_container.test_container.name type = "Block" diff --git a/test/functional/shared/resources/testdata/recipes/test-terraform-recipes/azure-storage/variables.tf b/test/functional/shared/resources/testdata/recipes/test-terraform-recipes/azure-storage/variables.tf index a1e8130e1a..b448fb39f2 100644 --- a/test/functional/shared/resources/testdata/recipes/test-terraform-recipes/azure-storage/variables.tf +++ b/test/functional/shared/resources/testdata/recipes/test-terraform-recipes/azure-storage/variables.tf @@ -1,7 +1,3 @@ -variable "name" { - type = string -} - variable "resource_group_name" { type = string } From c708fe27ea707c5befa15c0409f7e2f0e52bb03b Mon Sep 17 00:00:00 2001 From: Karishma Chawla Date: Wed, 7 Feb 2024 17:30:56 -0800 Subject: [PATCH 2/3] Add GH action to close stale PRs (#7143) # Description To declutter the PR queue and ensure that active contributions receive attention, enabling https://github.com/actions/stale github action to automatically close stale PRs after 90 days of inactivity, with a notification period of 7 days. This will provide contributors with a reasonable window to address any outstanding feedback or issues before the PR is automatically closed. We can adjust this timeframe in the future based on the feedback and learnings. We can also consider PRs labeled with certain labels to be excluded from this workflow if we see the need for this in the future: https://github.com/actions/stale?tab=readme-ov-file#exempt-pr-labels. ## Type of change - This pull request adds or changes features of Radius and has an approved issue (issue link required). - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: https://github.com/radius-project/radius/issues/7151 --------- Signed-off-by: Karishma Chawla Signed-off-by: karishma-chawla <74574173+karishma-chawla@users.noreply.github.com> Co-authored-by: karishma-chawla <74574173+karishma-chawla@users.noreply.github.com> --- .github/workflows/stale-prs.yml | 27 +++++++++++++++++++ .../contributing-pull-requests/README.md | 6 ++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/stale-prs.yml diff --git a/.github/workflows/stale-prs.yml b/.github/workflows/stale-prs.yml new file mode 100644 index 0000000000..04eec4cf6e --- /dev/null +++ b/.github/workflows/stale-prs.yml @@ -0,0 +1,27 @@ +# This workflow warns and then closes PRs that have had no activity for 90 days. +# +# For more information, see: +# https://github.com/actions/stale +name: Close stale pull requests + +on: + schedule: + - cron: '0 18 * * *' # Run the workflow every day at 6PM UTC (10AM PST). + +jobs: + stale: + + runs-on: ubuntu-latest + permissions: + pull-requests: write + + steps: + - uses: actions/stale@v5 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-pr-message: 'This pull request has been automatically marked as stale because it has been inactive for 90 days. Remove stale label or comment or this PR will be closed in 7 days.' + stale-pr-label: 'stale' + days-before-pr-stale: 90 # 3 months + days-before-pr-close: 7 + days-before-issue-stale: -1 + days-before-issue-close: -1 diff --git a/docs/contributing/contributing-pull-requests/README.md b/docs/contributing/contributing-pull-requests/README.md index 70fdbf9b2b..ddb8a72446 100644 --- a/docs/contributing/contributing-pull-requests/README.md +++ b/docs/contributing/contributing-pull-requests/README.md @@ -102,4 +102,8 @@ If you are the code reviewer, it's your responsibility to follow up (politely) i We welcome **any contributor or community member** to engage with **any pull request** on our repository. Feel free to make suggestions for improvements and ask questions that are relevant. If you're asking questions for your learning, please make it clear that your questions are "non-blocking" for the pull request. -See the [code reviewing documentation](../contributing-code/contributing-code-reviewing/README.md) for guidance on code reviewing. \ No newline at end of file +See the [code reviewing documentation](../contributing-code/contributing-code-reviewing/README.md) for guidance on code reviewing. + +## Inactive Pull Requests + +Pull requests that have been inactive for 90 days will be marked with a stale label. They will automatically be closed after a subsequent 7 days of inactivity. This timeframe may be adjusted in the future based on project needs. \ No newline at end of file From e261d3a88e5ff3aef43b86fa76597353cde7713c Mon Sep 17 00:00:00 2001 From: Karishma Chawla Date: Wed, 7 Feb 2024 19:40:50 -0800 Subject: [PATCH 3/3] Rename stale PRs workflow filename (#7152) # Description Renaming the stale PRs workflow filename to be more explicit. Feedback from https://github.com/radius-project/radius/pull/7143#discussion_r1482147769 ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Signed-off-by: karishma-chawla <74574173+karishma-chawla@users.noreply.github.com> Co-authored-by: karishma-chawla <74574173+karishma-chawla@users.noreply.github.com> --- .github/workflows/{stale-prs.yml => close-stale-prs.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{stale-prs.yml => close-stale-prs.yml} (100%) diff --git a/.github/workflows/stale-prs.yml b/.github/workflows/close-stale-prs.yml similarity index 100% rename from .github/workflows/stale-prs.yml rename to .github/workflows/close-stale-prs.yml