From 24de9c1145d33a053bcdaaef4ff8a88ee396c688 Mon Sep 17 00:00:00 2001 From: Ludovico Magnocavallo Date: Sat, 30 Jul 2022 17:46:11 +0200 Subject: [PATCH 01/11] Update CHANGELOG.md --- CHANGELOG.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 54 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b458de1..d60ead44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,60 @@ All notable changes to this project will be documented in this file. ## Unreleased -- add support for IAM and Cloud Build triggers to source repository module -- add `id` output to service account module -- add support for secrets to cloud function module -- new binary authorization module -- add `consumer_accept_list` option to `apigee-x-instance` module -- fix addons for GKE autopilot +- [#761] Fix gke hub module features condition (ludoo) +- [#760] GKE hub module refactor (ludoo) +- [#759] FIX: Missing value to format principalSet (imp14a) +- [#756] Changed cluster id sensitivity (apichick) +- [#757] Remove key_algorithm from glb/ilb-l7 examples (ludoo) +- [#753] Add support for IAM bindings on service accounts to project factory (ludoo) +- [#752] Added dependency on google_compute_shared_vpc_host_project.shared_vpc… (apichick) +- [#747] Added gkehub.googleapis.com to jit services (apichick) +- [#746] Update multi region cloud SQL markdown file (bensadikgoogle) +- [#745] FIX: 00-cicd stage - Gitlab and Github providers (imp14a) +- [#744] Fixed issue with missing project reference in Cloud DNS data source (rosmo) +- [#741] Added servicemesh feature to GKE hub and included fleet robot service… (apichick) +- [#737] Move Cloud Run VPC Connector annotations to template metadata (#735) (sethmoon) +- [#734] FAST: Use spot VMs for test VM and for NVAs (sruffilli) +- [#733] Fix dataset name (juliocc) +- [#732] Add support for topic message duration to pubsub module (ludoo) +- [#731] Avoid setting empty IAM binding in subnet factory (ludoo) +- [#712] AD FS example (apichick) +- [#730] FAST - add billing IAM for billing group (ludoo) +- [#729] Fix connector create logic in cloud run module (ludoo) +- [#655] New example for a data playground Terraform setup (aymanfarhat) +- [#726] Fix documentation for organization-policy module (averbuks) +- [#722] OrgPolicy module (factory) using new org-policy API, #698 (averbuks) +- [#721] FAST: Resman: Update billing.tf (sruffilli) +- [#716] FAST - added missing format argument in branch-pf-dev-sa-cicd (mgfeller) +- [#715] Fix optional service accounts in networking stages (ludoo) +- [#695] Modified reserved IP address outputs (apichick) +- [#711] FAST - updated several stage READMEs about usage of *.auto.tfvars files (mgfeller) +- [#709] when using managed prometheus or passing monitoring config there is e… (psabhishekgoogle) +- [#702] FAST - trigger GitHub workflow also on PR synchronize event (mgfeller) +- [#708] Fix #705 (ludoo) +- [#703] FAST: configuration switches for features (ludoo) +- [#707] Fix addons for autopilot clusters, add tests for gke-cluster. (juliocc) +- [#706] Bump providers versions and pin versions for tests (juliocc) +- [#704] Add `consumer_accept_list` to `apigee-x-instance` (juliocc) +- [#692] Fix KMS delegation role (lcaggio) +- [#696] Added missing image in GLB and Cloud Armor example (apichick) +- [#699] Add repository_owner to GitHub identity attributes (ludoo) +- [#694] Allow creating repositories in Gitlab/GitHub via Terraform and other CI/CD improvements (rosmo) +- [#690] Fix stages tfvars links (lcaggio) +- [#676] Fast/group creation gif (amgoogle) +- [#689] Binary authorization module and example (apichick) +- [#687] Fix for fast project factory (dosti-tee) +- [#683] Binary authorization module and example (apichick) +- [#686] Revert "Binary authorization module and example" (ludoo) +- [#668] FAST cleanup instructions (ajlopezn) +- [#680] fix: Raise ValueError when check_names detects overlong names (27Bslash6) +- [#682] FAST: fix CI/CD source repositories in stage 01 (imp14a) +- [#684] Cloud function module: add support for secrets (ludoo) +- [#669] FAST: CI/CD support for Source Repository and Cloud Build (ludoo) +- [#671] FAST: Fix Gitlab WIF attributes (ludoo) +- [#675] FAST: Fix audit logs when using pubsub as destination (juliocc) +- [#674] FAST: Remove team folders comment from 01 variables, clarify README (ludoo) +- [#672] Module attribution and version updater tool, plus release automation (rosmo) **FAST** From e16d4f004b07472d742dee2d1372cb1797ff2a81 Mon Sep 17 00:00:00 2001 From: Ludovico Magnocavallo Date: Sat, 30 Jul 2022 17:47:13 +0200 Subject: [PATCH 02/11] Update CHANGELOG.md --- CHANGELOG.md | 117 ++++++++++++++++++++++++--------------------------- 1 file changed, 54 insertions(+), 63 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d60ead44..d38702b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,69 +4,60 @@ All notable changes to this project will be documented in this file. ## Unreleased -- [#761] Fix gke hub module features condition (ludoo) -- [#760] GKE hub module refactor (ludoo) -- [#759] FIX: Missing value to format principalSet (imp14a) -- [#756] Changed cluster id sensitivity (apichick) -- [#757] Remove key_algorithm from glb/ilb-l7 examples (ludoo) -- [#753] Add support for IAM bindings on service accounts to project factory (ludoo) -- [#752] Added dependency on google_compute_shared_vpc_host_project.shared_vpc… (apichick) -- [#747] Added gkehub.googleapis.com to jit services (apichick) -- [#746] Update multi region cloud SQL markdown file (bensadikgoogle) -- [#745] FIX: 00-cicd stage - Gitlab and Github providers (imp14a) -- [#744] Fixed issue with missing project reference in Cloud DNS data source (rosmo) -- [#741] Added servicemesh feature to GKE hub and included fleet robot service… (apichick) -- [#737] Move Cloud Run VPC Connector annotations to template metadata (#735) (sethmoon) -- [#734] FAST: Use spot VMs for test VM and for NVAs (sruffilli) -- [#733] Fix dataset name (juliocc) -- [#732] Add support for topic message duration to pubsub module (ludoo) -- [#731] Avoid setting empty IAM binding in subnet factory (ludoo) -- [#712] AD FS example (apichick) -- [#730] FAST - add billing IAM for billing group (ludoo) -- [#729] Fix connector create logic in cloud run module (ludoo) -- [#655] New example for a data playground Terraform setup (aymanfarhat) -- [#726] Fix documentation for organization-policy module (averbuks) -- [#722] OrgPolicy module (factory) using new org-policy API, #698 (averbuks) -- [#721] FAST: Resman: Update billing.tf (sruffilli) -- [#716] FAST - added missing format argument in branch-pf-dev-sa-cicd (mgfeller) -- [#715] Fix optional service accounts in networking stages (ludoo) -- [#695] Modified reserved IP address outputs (apichick) -- [#711] FAST - updated several stage READMEs about usage of *.auto.tfvars files (mgfeller) -- [#709] when using managed prometheus or passing monitoring config there is e… (psabhishekgoogle) -- [#702] FAST - trigger GitHub workflow also on PR synchronize event (mgfeller) -- [#708] Fix #705 (ludoo) -- [#703] FAST: configuration switches for features (ludoo) -- [#707] Fix addons for autopilot clusters, add tests for gke-cluster. (juliocc) -- [#706] Bump providers versions and pin versions for tests (juliocc) -- [#704] Add `consumer_accept_list` to `apigee-x-instance` (juliocc) -- [#692] Fix KMS delegation role (lcaggio) -- [#696] Added missing image in GLB and Cloud Armor example (apichick) -- [#699] Add repository_owner to GitHub identity attributes (ludoo) -- [#694] Allow creating repositories in Gitlab/GitHub via Terraform and other CI/CD improvements (rosmo) -- [#690] Fix stages tfvars links (lcaggio) -- [#676] Fast/group creation gif (amgoogle) -- [#689] Binary authorization module and example (apichick) -- [#687] Fix for fast project factory (dosti-tee) -- [#683] Binary authorization module and example (apichick) -- [#686] Revert "Binary authorization module and example" (ludoo) -- [#668] FAST cleanup instructions (ajlopezn) -- [#680] fix: Raise ValueError when check_names detects overlong names (27Bslash6) -- [#682] FAST: fix CI/CD source repositories in stage 01 (imp14a) -- [#684] Cloud function module: add support for secrets (ludoo) -- [#669] FAST: CI/CD support for Source Repository and Cloud Build (ludoo) -- [#671] FAST: Fix Gitlab WIF attributes (ludoo) -- [#675] FAST: Fix audit logs when using pubsub as destination (juliocc) -- [#674] FAST: Remove team folders comment from 01 variables, clarify README (ludoo) -- [#672] Module attribution and version updater tool, plus release automation (rosmo) - -**FAST** - -- add support for Cloud Source Repositories in stage 0 and 1 CI/CD -- fix Gitlab workflow indentation -- remove unsupported attributes and add supported ones to the Gitlab mapping used for Workload Identity Federation pools -- add roles for CI/CD source repositories to stage 1 service account on automation project -- fixes to CI/CD source repositories in stage 1 -- implement feature flags for FAST +- Fix gke hub module features condition (ludoo) #761 +- GKE hub module refactor (ludoo) #760 +- FIX: Missing value to format principalSet (imp14a) #759 +- Changed cluster id sensitivity (apichick) #756 +- Remove key_algorithm from glb/ilb-l7 examples (ludoo) #757 +- Add support for IAM bindings on service accounts to project factory (ludoo) #753 +- Added dependency on google_compute_shared_vpc_host_project.shared_vpc… (apichick) #752 +- Added gkehub.googleapis.com to jit services (apichick) #747 +- Update multi region cloud SQL markdown file (bensadikgoogle) #746 +- FIX: 00-cicd stage - Gitlab and Github providers (imp14a) #745 +- Fixed issue with missing project reference in Cloud DNS data source (rosmo) #744 +- Added servicemesh feature to GKE hub and included fleet robot service… (apichick) #741 +- Move Cloud Run VPC Connector annotations to template metadata (#735) (sethmoon) #737 +- FAST: Use spot VMs for test VM and for NVAs (sruffilli) #734 +- Fix dataset name (juliocc) #733 +- Add support for topic message duration to pubsub module (ludoo) #732 +- Avoid setting empty IAM binding in subnet factory (ludoo) #731 +- AD FS example (apichick) #712 +- FAST - add billing IAM for billing group (ludoo) #730 +- Fix connector create logic in cloud run module (ludoo) #729 +- New example for a data playground Terraform setup (aymanfarhat) #655 +- Fix documentation for organization-policy module (averbuks) #726 +- OrgPolicy module (factory) using new org-policy API, #698 (averbuks) #722 +- FAST: Resman: Update billing.tf (sruffilli) #721 +- FAST - added missing format argument in branch-pf-dev-sa-cicd (mgfeller) #716 +- Fix optional service accounts in networking stages (ludoo) #715 +- Modified reserved IP address outputs (apichick) #695 +- FAST - updated several stage READMEs about usage of *.auto.tfvars files (mgfeller) #711 +- when using managed prometheus or passing monitoring config there is e… (psabhishekgoogle) #709 +- FAST - trigger GitHub workflow also on PR synchronize event (mgfeller) #702 +- Fix #705 (ludoo) #708 +- FAST: configuration switches for features (ludoo) #703 +- Fix addons for autopilot clusters, add tests for gke-cluster. (juliocc) #707 +- Bump providers versions and pin versions for tests (juliocc) #706 +- Add `consumer_accept_list` to `apigee-x-instance` (juliocc) #704 +- Fix KMS delegation role (lcaggio) #692 +- Added missing image in GLB and Cloud Armor example (apichick) #696 +- Add repository_owner to GitHub identity attributes (ludoo) #699 +- Allow creating repositories in Gitlab/GitHub via Terraform and other CI/CD improvements (rosmo) #694 +- Fix stages tfvars links (lcaggio) #690 +- Fast/group creation gif (amgoogle) #676 +- Binary authorization module and example (apichick) #689 +- Fix for fast project factory (dosti-tee) #687 +- Binary authorization module and example (apichick) #683 +- Revert "Binary authorization module and example" (ludoo) #686 +- FAST cleanup instructions (ajlopezn) #668 +- fix: Raise ValueError when check_names detects overlong names (27Bslash6) #680 +- FAST: fix CI/CD source repositories in stage 01 (imp14a) #682 +- Cloud function module: add support for secrets (ludoo) #684 +- FAST: CI/CD support for Source Repository and Cloud Build (ludoo) #669 +- FAST: Fix Gitlab WIF attributes (ludoo) #671 +- FAST: Fix audit logs when using pubsub as destination (juliocc) #675 +- FAST: Remove team folders comment from 01 variables, clarify README (ludoo) #674 +- Module attribution and version updater tool, plus release automation (rosmo) #672 ## [16.0.0] - 2022-06-06 From fa0fabe1c7e6a7aa97f46a6759f0f3dfe3d764ac Mon Sep 17 00:00:00 2001 From: Ludovico Magnocavallo Date: Sat, 30 Jul 2022 17:51:32 +0200 Subject: [PATCH 03/11] Update CHANGELOG.md --- CHANGELOG.md | 108 +++++++++++++++++++++++++-------------------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d38702b0..da3d8c91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,60 +4,60 @@ All notable changes to this project will be documented in this file. ## Unreleased -- Fix gke hub module features condition (ludoo) #761 -- GKE hub module refactor (ludoo) #760 -- FIX: Missing value to format principalSet (imp14a) #759 -- Changed cluster id sensitivity (apichick) #756 -- Remove key_algorithm from glb/ilb-l7 examples (ludoo) #757 -- Add support for IAM bindings on service accounts to project factory (ludoo) #753 -- Added dependency on google_compute_shared_vpc_host_project.shared_vpc… (apichick) #752 -- Added gkehub.googleapis.com to jit services (apichick) #747 -- Update multi region cloud SQL markdown file (bensadikgoogle) #746 -- FIX: 00-cicd stage - Gitlab and Github providers (imp14a) #745 -- Fixed issue with missing project reference in Cloud DNS data source (rosmo) #744 -- Added servicemesh feature to GKE hub and included fleet robot service… (apichick) #741 -- Move Cloud Run VPC Connector annotations to template metadata (#735) (sethmoon) #737 -- FAST: Use spot VMs for test VM and for NVAs (sruffilli) #734 -- Fix dataset name (juliocc) #733 -- Add support for topic message duration to pubsub module (ludoo) #732 -- Avoid setting empty IAM binding in subnet factory (ludoo) #731 -- AD FS example (apichick) #712 -- FAST - add billing IAM for billing group (ludoo) #730 -- Fix connector create logic in cloud run module (ludoo) #729 -- New example for a data playground Terraform setup (aymanfarhat) #655 -- Fix documentation for organization-policy module (averbuks) #726 -- OrgPolicy module (factory) using new org-policy API, #698 (averbuks) #722 -- FAST: Resman: Update billing.tf (sruffilli) #721 -- FAST - added missing format argument in branch-pf-dev-sa-cicd (mgfeller) #716 -- Fix optional service accounts in networking stages (ludoo) #715 -- Modified reserved IP address outputs (apichick) #695 -- FAST - updated several stage READMEs about usage of *.auto.tfvars files (mgfeller) #711 -- when using managed prometheus or passing monitoring config there is e… (psabhishekgoogle) #709 -- FAST - trigger GitHub workflow also on PR synchronize event (mgfeller) #702 -- Fix #705 (ludoo) #708 -- FAST: configuration switches for features (ludoo) #703 -- Fix addons for autopilot clusters, add tests for gke-cluster. (juliocc) #707 -- Bump providers versions and pin versions for tests (juliocc) #706 -- Add `consumer_accept_list` to `apigee-x-instance` (juliocc) #704 -- Fix KMS delegation role (lcaggio) #692 -- Added missing image in GLB and Cloud Armor example (apichick) #696 -- Add repository_owner to GitHub identity attributes (ludoo) #699 -- Allow creating repositories in Gitlab/GitHub via Terraform and other CI/CD improvements (rosmo) #694 -- Fix stages tfvars links (lcaggio) #690 -- Fast/group creation gif (amgoogle) #676 -- Binary authorization module and example (apichick) #689 -- Fix for fast project factory (dosti-tee) #687 -- Binary authorization module and example (apichick) #683 -- Revert "Binary authorization module and example" (ludoo) #686 -- FAST cleanup instructions (ajlopezn) #668 -- fix: Raise ValueError when check_names detects overlong names (27Bslash6) #680 -- FAST: fix CI/CD source repositories in stage 01 (imp14a) #682 -- Cloud function module: add support for secrets (ludoo) #684 -- FAST: CI/CD support for Source Repository and Cloud Build (ludoo) #669 -- FAST: Fix Gitlab WIF attributes (ludoo) #671 -- FAST: Fix audit logs when using pubsub as destination (juliocc) #675 -- FAST: Remove team folders comment from 01 variables, clarify README (ludoo) #674 -- Module attribution and version updater tool, plus release automation (rosmo) #672 +- Fix gke hub module features condition (ludoo) [#761](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/761) +- GKE hub module refactor (ludoo) [#760](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/760) +- FIX: Missing value to format principalSet (imp14a) [#759](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/759) +- Changed cluster id sensitivity (apichick) [#756](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/756) +- Remove key_algorithm from glb/ilb-l7 examples (ludoo) [#757](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/757) +- Add support for IAM bindings on service accounts to project factory (ludoo) [#753](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/753) +- Added dependency on google_compute_shared_vpc_host_project.shared_vpc… (apichick) [#752](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/752) +- Added gkehub.googleapis.com to jit services (apichick) [#747](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/747) +- Update multi region cloud SQL markdown file (bensadikgoogle) [#746](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/746) +- FIX: 00-cicd stage - Gitlab and Github providers (imp14a) [#745](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/745) +- Fixed issue with missing project reference in Cloud DNS data source (rosmo) [#744](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/744) +- Added servicemesh feature to GKE hub and included fleet robot service… (apichick) [#741](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/741) +- Move Cloud Run VPC Connector annotations to template metadata (#735) (sethmoon) [#737](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/737) +- FAST: Use spot VMs for test VM and for NVAs (sruffilli) [#734](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/734) +- Fix dataset name (juliocc) [#733](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/733) +- Add support for topic message duration to pubsub module (ludoo) [#732](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/732) +- Avoid setting empty IAM binding in subnet factory (ludoo) [#731](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/731) +- AD FS example (apichick) [#712](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/712) +- FAST - add billing IAM for billing group (ludoo) [#730](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/730) +- Fix connector create logic in cloud run module (ludoo) [#729](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/729) +- New example for a data playground Terraform setup (aymanfarhat) [#655](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/655) +- Fix documentation for organization-policy module (averbuks) [#726](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/726) +- OrgPolicy module (factory) using new org-policy API, #698 (averbuks) [#722](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/722) +- FAST: Resman: Update billing.tf (sruffilli) [#721](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/721) +- FAST - added missing format argument in branch-pf-dev-sa-cicd (mgfeller) [#716](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/716) +- Fix optional service accounts in networking stages (ludoo) [#715](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/715) +- Modified reserved IP address outputs (apichick) [#695](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/695) +- FAST - updated several stage READMEs about usage of *.auto.tfvars files (mgfeller) [#711](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/711) +- when using managed prometheus or passing monitoring config there is e… (psabhishekgoogle) [#709](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/709) +- FAST - trigger GitHub workflow also on PR synchronize event (mgfeller) [#702](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/702) +- Fix #705 (ludoo) [#708](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/708) +- FAST: configuration switches for features (ludoo) [#703](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/703) +- Fix addons for autopilot clusters, add tests for gke-cluster. (juliocc) [#707](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/707) +- Bump providers versions and pin versions for tests (juliocc) [#706](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/706) +- Add `consumer_accept_list` to `apigee-x-instance` (juliocc) [#704](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/704) +- Fix KMS delegation role (lcaggio) [#692](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/692) +- Added missing image in GLB and Cloud Armor example (apichick) [#696](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/696) +- Add repository_owner to GitHub identity attributes (ludoo) [#699](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/699) +- Allow creating repositories in Gitlab/GitHub via Terraform and other CI/CD improvements (rosmo) [#694](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/694) +- Fix stages tfvars links (lcaggio) [#690](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/690) +- Fast/group creation gif (amgoogle) [#676](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/676) +- Binary authorization module and example (apichick) [#689](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/689) +- Fix for fast project factory (dosti-tee) [#687](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/687) +- Binary authorization module and example (apichick) [#683](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/683) +- Revert "Binary authorization module and example" (ludoo) [#686](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/686) +- FAST cleanup instructions (ajlopezn) [#668](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/668) +- fix: Raise ValueError when check_names detects overlong names (27Bslash6) [#680](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/680) +- FAST: fix CI/CD source repositories in stage 01 (imp14a) [#682](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/682) +- Cloud function module: add support for secrets (ludoo) [#684](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/684) +- FAST: CI/CD support for Source Repository and Cloud Build (ludoo) [#669](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/669) +- FAST: Fix Gitlab WIF attributes (ludoo) [#671](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/671) +- FAST: Fix audit logs when using pubsub as destination (juliocc) [#675](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/675) +- FAST: Remove team folders comment from 01 variables, clarify README (ludoo) [#674](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/674) +- Module attribution and version updater tool, plus release automation (rosmo) [#672](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/672) ## [16.0.0] - 2022-06-06 From f513648638c895ef125922c732bf8d85a51f3509 Mon Sep 17 00:00:00 2001 From: Ludovico Magnocavallo Date: Sat, 30 Jul 2022 17:52:43 +0200 Subject: [PATCH 04/11] Update CHANGELOG.md --- CHANGELOG.md | 108 +++++++++++++++++++++++++-------------------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da3d8c91..3b82c678 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,60 +4,60 @@ All notable changes to this project will be documented in this file. ## Unreleased -- Fix gke hub module features condition (ludoo) [#761](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/761) -- GKE hub module refactor (ludoo) [#760](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/760) -- FIX: Missing value to format principalSet (imp14a) [#759](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/759) -- Changed cluster id sensitivity (apichick) [#756](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/756) -- Remove key_algorithm from glb/ilb-l7 examples (ludoo) [#757](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/757) -- Add support for IAM bindings on service accounts to project factory (ludoo) [#753](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/753) -- Added dependency on google_compute_shared_vpc_host_project.shared_vpc… (apichick) [#752](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/752) -- Added gkehub.googleapis.com to jit services (apichick) [#747](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/747) -- Update multi region cloud SQL markdown file (bensadikgoogle) [#746](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/746) -- FIX: 00-cicd stage - Gitlab and Github providers (imp14a) [#745](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/745) -- Fixed issue with missing project reference in Cloud DNS data source (rosmo) [#744](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/744) -- Added servicemesh feature to GKE hub and included fleet robot service… (apichick) [#741](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/741) -- Move Cloud Run VPC Connector annotations to template metadata (#735) (sethmoon) [#737](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/737) -- FAST: Use spot VMs for test VM and for NVAs (sruffilli) [#734](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/734) -- Fix dataset name (juliocc) [#733](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/733) -- Add support for topic message duration to pubsub module (ludoo) [#732](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/732) -- Avoid setting empty IAM binding in subnet factory (ludoo) [#731](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/731) -- AD FS example (apichick) [#712](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/712) -- FAST - add billing IAM for billing group (ludoo) [#730](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/730) -- Fix connector create logic in cloud run module (ludoo) [#729](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/729) -- New example for a data playground Terraform setup (aymanfarhat) [#655](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/655) -- Fix documentation for organization-policy module (averbuks) [#726](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/726) -- OrgPolicy module (factory) using new org-policy API, #698 (averbuks) [#722](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/722) -- FAST: Resman: Update billing.tf (sruffilli) [#721](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/721) -- FAST - added missing format argument in branch-pf-dev-sa-cicd (mgfeller) [#716](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/716) -- Fix optional service accounts in networking stages (ludoo) [#715](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/715) -- Modified reserved IP address outputs (apichick) [#695](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/695) -- FAST - updated several stage READMEs about usage of *.auto.tfvars files (mgfeller) [#711](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/711) -- when using managed prometheus or passing monitoring config there is e… (psabhishekgoogle) [#709](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/709) -- FAST - trigger GitHub workflow also on PR synchronize event (mgfeller) [#702](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/702) -- Fix #705 (ludoo) [#708](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/708) -- FAST: configuration switches for features (ludoo) [#703](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/703) -- Fix addons for autopilot clusters, add tests for gke-cluster. (juliocc) [#707](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/707) -- Bump providers versions and pin versions for tests (juliocc) [#706](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/706) -- Add `consumer_accept_list` to `apigee-x-instance` (juliocc) [#704](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/704) -- Fix KMS delegation role (lcaggio) [#692](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/692) -- Added missing image in GLB and Cloud Armor example (apichick) [#696](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/696) -- Add repository_owner to GitHub identity attributes (ludoo) [#699](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/699) -- Allow creating repositories in Gitlab/GitHub via Terraform and other CI/CD improvements (rosmo) [#694](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/694) -- Fix stages tfvars links (lcaggio) [#690](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/690) -- Fast/group creation gif (amgoogle) [#676](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/676) -- Binary authorization module and example (apichick) [#689](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/689) -- Fix for fast project factory (dosti-tee) [#687](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/687) -- Binary authorization module and example (apichick) [#683](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/683) -- Revert "Binary authorization module and example" (ludoo) [#686](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/686) -- FAST cleanup instructions (ajlopezn) [#668](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/668) -- fix: Raise ValueError when check_names detects overlong names (27Bslash6) [#680](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/680) -- FAST: fix CI/CD source repositories in stage 01 (imp14a) [#682](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/682) -- Cloud function module: add support for secrets (ludoo) [#684](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/684) -- FAST: CI/CD support for Source Repository and Cloud Build (ludoo) [#669](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/669) -- FAST: Fix Gitlab WIF attributes (ludoo) [#671](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/671) -- FAST: Fix audit logs when using pubsub as destination (juliocc) [#675](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/675) -- FAST: Remove team folders comment from 01 variables, clarify README (ludoo) [#674](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/674) -- Module attribution and version updater tool, plus release automation (rosmo) [#672](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/672) +- [[#761](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/761)] Fix gke hub module features condition (ludoo) +- [[#760](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/760)] GKE hub module refactor (ludoo) +- [[#759](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/759)] FIX: Missing value to format principalSet (imp14a) +- [[#756](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/756)] Changed cluster id sensitivity (apichick) +- [[#757](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/757)] Remove key_algorithm from glb/ilb-l7 examples (ludoo) +- [[#753](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/753)] Add support for IAM bindings on service accounts to project factory (ludoo) +- [[#752](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/752)] Added dependency on google_compute_shared_vpc_host_project.shared_vpc… (apichick) +- [[#747](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/747)] Added gkehub.googleapis.com to jit services (apichick) +- [[#746](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/746)] Update multi region cloud SQL markdown file (bensadikgoogle) +- [[#745](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/745)] FIX: 00-cicd stage - Gitlab and Github providers (imp14a) +- [[#744](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/744)] Fixed issue with missing project reference in Cloud DNS data source (rosmo) +- [[#741](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/741)] Added servicemesh feature to GKE hub and included fleet robot service… (apichick) +- [[#737](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/737)] Move Cloud Run VPC Connector annotations to template metadata (#735) (sethmoon) +- [[#734](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/734)] FAST: Use spot VMs for test VM and for NVAs (sruffilli) +- [[#733](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/733)] Fix dataset name (juliocc) +- [[#732](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/732)] Add support for topic message duration to pubsub module (ludoo) +- [[#731](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/731)] Avoid setting empty IAM binding in subnet factory (ludoo) +- [[#712](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/712)] AD FS example (apichick) +- [[#730](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/730)] FAST - add billing IAM for billing group (ludoo) +- [[#729](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/729)] Fix connector create logic in cloud run module (ludoo) +- [[#655](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/655)] New example for a data playground Terraform setup (aymanfarhat) +- [[#726](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/726)] Fix documentation for organization-policy module (averbuks) +- [[#722](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/722)] OrgPolicy module (factory) using new org-policy API, #698 (averbuks) +- [[#721](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/721)] FAST: Resman: Update billing.tf (sruffilli) +- [[#716](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/716)] FAST - added missing format argument in branch-pf-dev-sa-cicd (mgfeller) +- [[#715](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/715)] Fix optional service accounts in networking stages (ludoo) +- [[#695](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/695)] Modified reserved IP address outputs (apichick) +- [[#711](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/711)] FAST - updated several stage READMEs about usage of *.auto.tfvars files (mgfeller) +- [[#709](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/709)] when using managed prometheus or passing monitoring config there is e… (psabhishekgoogle) +- [[#702](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/702)] FAST - trigger GitHub workflow also on PR synchronize event (mgfeller) +- [[#708](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/708)] Fix #705 (ludoo) +- [[#703](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/703)] FAST: configuration switches for features (ludoo) +- [[#707](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/707)] Fix addons for autopilot clusters, add tests for gke-cluster. (juliocc) +- [[#706](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/706)] Bump providers versions and pin versions for tests (juliocc) +- [[#704](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/704)] Add `consumer_accept_list` to `apigee-x-instance` (juliocc) +- [[#692](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/692)] Fix KMS delegation role (lcaggio) +- [[#696](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/696)] Added missing image in GLB and Cloud Armor example (apichick) +- [[#699](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/699)] Add repository_owner to GitHub identity attributes (ludoo) +- [[#694](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/694)] Allow creating repositories in Gitlab/GitHub via Terraform and other CI/CD improvements (rosmo) +- [[#690](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/690)] Fix stages tfvars links (lcaggio) +- [[#676](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/676)] Fast/group creation gif (amgoogle) +- [[#689](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/689)] Binary authorization module and example (apichick) +- [[#687](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/687)] Fix for fast project factory (dosti-tee) +- [[#683](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/683)] Binary authorization module and example (apichick) +- [[#686](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/686)] Revert "Binary authorization module and example" (ludoo) +- [[#668](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/668)] FAST cleanup instructions (ajlopezn) +- [[#680](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/680)] fix: Raise ValueError when check_names detects overlong names (27Bslash6) +- [[#682](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/682)] FAST: fix CI/CD source repositories in stage 01 (imp14a) +- [[#684](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/684)] Cloud function module: add support for secrets (ludoo) +- [[#669](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/669)] FAST: CI/CD support for Source Repository and Cloud Build (ludoo) +- [[#671](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/671)] FAST: Fix Gitlab WIF attributes (ludoo) +- [[#675](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/675)] FAST: Fix audit logs when using pubsub as destination (juliocc) +- [[#674](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/674)] FAST: Remove team folders comment from 01 variables, clarify README (ludoo) +- [[#672](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/672)] Module attribution and version updater tool, plus release automation (rosmo) ## [16.0.0] - 2022-06-06 From 3776120ba0e2ca7e33d4ed64d7052b7d689576e9 Mon Sep 17 00:00:00 2001 From: Ludovico Magnocavallo Date: Sat, 30 Jul 2022 17:04:00 +0000 Subject: [PATCH 05/11] first test (#762) --- .github/workflows/merge-pr.yml | 51 ++++++++++++++++ CHANGELOG.md | 2 + tools/changelog.py | 103 +++++++++++++++++++++++++++++++++ tools/requirements.txt | 2 + 4 files changed, 158 insertions(+) create mode 100644 .github/workflows/merge-pr.yml create mode 100755 tools/changelog.py diff --git a/.github/workflows/merge-pr.yml b/.github/workflows/merge-pr.yml new file mode 100644 index 00000000..05946e8d --- /dev/null +++ b/.github/workflows/merge-pr.yml @@ -0,0 +1,51 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Post-merge tasks + +on: + pull_request: + branches: + - master + types: + - closed + +env: + PYTHON_VERSION: 3.10 + +jobs: + if_merged: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ env.PYTHON_VERSION }} + - name: Install dependencies + run: | + pip install -r tools/requirements.txt + - name: Update Changelog + run: | + python3 tools/changelog.py --token secrets.GITHUB_TOKEN CHANGELOG.md + - name: Commit and push Changelog + env: + CI_COMMIT_MESSAGE: Update Changelog + CI_COMMIT_AUTHOR: Fabric Repo Workflows + run: | + git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" + git config --global user.email "username@users.noreply.github.com" + git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}" + git push diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b82c678..4c268bd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. ## Unreleased + - [[#761](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/761)] Fix gke hub module features condition (ludoo) - [[#760](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/760)] GKE hub module refactor (ludoo) - [[#759](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/759)] FIX: Missing value to format principalSet (imp14a) @@ -58,6 +59,7 @@ All notable changes to this project will be documented in this file. - [[#675](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/675)] FAST: Fix audit logs when using pubsub as destination (juliocc) - [[#674](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/674)] FAST: Remove team folders comment from 01 variables, clarify README (ludoo) - [[#672](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/672)] Module attribution and version updater tool, plus release automation (rosmo) + ## [16.0.0] - 2022-06-06 diff --git a/tools/changelog.py b/tools/changelog.py new file mode 100755 index 00000000..e5113f8e --- /dev/null +++ b/tools/changelog.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python3 +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import click +import collections +import os +import pprint +import re + +import ghapi.all +import iso8601 + +MARK_BEGIN = '' +MARK_END = '' +ORG = 'GoogleCloudPlatform' +REPO = 'cloud-foundation-fabric' + +PullRequest = collections.namedtuple('PullRequest', 'id author title merged_at') + + +def format_pull(pr): + url = f'https://github.com/{ORG}/{REPO}/pull/' + return f'- [[#{pr.id}]({url}{pr.id})] {pr.title} ({pr.author})' + + +def get_api(token, owner=ORG, name=REPO): + return ghapi.all.GhApi(owner=owner, repo=name, token=token) + + +def get_pulls(token, api=None): + api = api or get_api(token) + release = api.repos.get_latest_release() + release_published_at = iso8601.parse_date(release.published_at) + + while True: + page = 1 + for item in api.pulls.list(base='master', state='closed', sort='updated', + direction='desc', page=page, per_page=100): + try: + merged_at = iso8601.parse_date(item['merged_at']) + except iso8601.ParseError: + continue + pr = PullRequest(item['number'], item['user']['login'], item['title'], + merged_at) + if pr.merged_at <= release_published_at: + page = None + break + yield pr + if page is None: + break + page += 1 + + +def write_doc(path, snippet): + 'Replace changelog file.' + try: + doc = open(path).read() + except (IOError, OSError) as e: + raise SystemExit(f'Error opening {path}: {e.args[0]}') + m = re.search('(?sm)%s\n(.*)\n%s' % (MARK_BEGIN, MARK_END), doc) + if not m: + raise SystemExit('Mark not found.') + start, end = m.start(), m.end() + try: + open(path, 'w').write('\n'.join([ + doc[:start].rstrip(), + f'\n{MARK_BEGIN}', + snippet, + f'{MARK_END}\n', + doc[end:].lstrip(), + ])) + except (IOError, OSError) as e: + raise SystemExit(f'Error replacing {path}: {e.args[0]}') + + +@click.command +@click.option('--token', required=True, envvar='GH_TOKEN') +@click.argument('changelog', required=False, type=click.Path(exists=True)) +def main(token, changelog=None): + buffer = [] + for pr in get_pulls(token=token): + buffer.append(format_pull(pr)) + buffer = '\n'.join(buffer) + if not changelog: + print(buffer) + else: + write_doc(changelog, buffer) + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/tools/requirements.txt b/tools/requirements.txt index 8c7dd54a..1b01cfa0 100644 --- a/tools/requirements.txt +++ b/tools/requirements.txt @@ -1,5 +1,7 @@ click deepdiff +ghapi +iso8601 marko requests yamale From a2b87b4560cbbc330084987667061abce24e26f5 Mon Sep 17 00:00:00 2001 From: Ludovico Magnocavallo Date: Sat, 30 Jul 2022 19:05:22 +0200 Subject: [PATCH 06/11] fix merge workflow --- .github/workflows/merge-pr.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/merge-pr.yml b/.github/workflows/merge-pr.yml index 05946e8d..717f2d27 100644 --- a/.github/workflows/merge-pr.yml +++ b/.github/workflows/merge-pr.yml @@ -21,9 +21,6 @@ on: types: - closed -env: - PYTHON_VERSION: 3.10 - jobs: if_merged: if: github.event.pull_request.merged == true @@ -33,7 +30,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: ${{ env.PYTHON_VERSION }} + python-version: "3.10" - name: Install dependencies run: | pip install -r tools/requirements.txt From 79253f3ec2cbb964c711b8cfd82457b6558ff7cc Mon Sep 17 00:00:00 2001 From: Ludovico Magnocavallo Date: Sat, 30 Jul 2022 19:08:08 +0200 Subject: [PATCH 07/11] allow running pr merge workflow --- .github/workflows/merge-pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/merge-pr.yml b/.github/workflows/merge-pr.yml index 717f2d27..20e2c345 100644 --- a/.github/workflows/merge-pr.yml +++ b/.github/workflows/merge-pr.yml @@ -20,6 +20,7 @@ on: - master types: - closed + workflow_dispatch: jobs: if_merged: From fab0566b9d678eb43cb3f22f3db77d62e13a673a Mon Sep 17 00:00:00 2001 From: Ludovico Magnocavallo Date: Sat, 30 Jul 2022 19:19:16 +0200 Subject: [PATCH 08/11] change merge workflow --- .github/workflows/merge-pr.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/merge-pr.yml b/.github/workflows/merge-pr.yml index 20e2c345..3386d33a 100644 --- a/.github/workflows/merge-pr.yml +++ b/.github/workflows/merge-pr.yml @@ -21,10 +21,15 @@ on: types: - closed workflow_dispatch: + inputs: + force: + description: "Force running from workflow dispatch." + required: false + type: boolean jobs: if_merged: - if: github.event.pull_request.merged == true + if: github.event.pull_request.merged == true || ${{github.event.inputs.force}} runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From d075e674259296379f2beddb06122a89fd3f5550 Mon Sep 17 00:00:00 2001 From: Ludovico Magnocavallo Date: Sat, 30 Jul 2022 19:29:50 +0200 Subject: [PATCH 09/11] workflow permissions --- .github/workflows/merge-pr.yml | 4 ++++ tools/changelog.py | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/merge-pr.yml b/.github/workflows/merge-pr.yml index 3386d33a..934ca0fb 100644 --- a/.github/workflows/merge-pr.yml +++ b/.github/workflows/merge-pr.yml @@ -27,6 +27,10 @@ on: required: false type: boolean +permissions: + contents: write + pull-requests: read + jobs: if_merged: if: github.event.pull_request.merged == true || ${{github.event.inputs.force}} diff --git a/tools/changelog.py b/tools/changelog.py index e5113f8e..d4f98d55 100755 --- a/tools/changelog.py +++ b/tools/changelog.py @@ -90,8 +90,11 @@ def write_doc(path, snippet): @click.argument('changelog', required=False, type=click.Path(exists=True)) def main(token, changelog=None): buffer = [] - for pr in get_pulls(token=token): - buffer.append(format_pull(pr)) + try: + for pr in get_pulls(token=token): + buffer.append(format_pull(pr)) + except Exception as e: + raise SystemExit(f'API error: {e}') buffer = '\n'.join(buffer) if not changelog: print(buffer) From 6efce68b1d8596d5617cd2464e56b6b52b925507 Mon Sep 17 00:00:00 2001 From: Ludovico Magnocavallo Date: Sat, 30 Jul 2022 19:37:19 +0200 Subject: [PATCH 10/11] fix merge workflow --- .github/workflows/merge-pr.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/merge-pr.yml b/.github/workflows/merge-pr.yml index 934ca0fb..e9e0ee11 100644 --- a/.github/workflows/merge-pr.yml +++ b/.github/workflows/merge-pr.yml @@ -27,9 +27,9 @@ on: required: false type: boolean -permissions: - contents: write - pull-requests: read +# permissions: +# contents: write +# pull-requests: read jobs: if_merged: @@ -46,7 +46,7 @@ jobs: pip install -r tools/requirements.txt - name: Update Changelog run: | - python3 tools/changelog.py --token secrets.GITHUB_TOKEN CHANGELOG.md + python3 tools/changelog.py --token ${{ secrets.GITHUB_TOKEN }} CHANGELOG.md - name: Commit and push Changelog env: CI_COMMIT_MESSAGE: Update Changelog From b5162162eca45852ef790d7a3638b6bac674378b Mon Sep 17 00:00:00 2001 From: Ludovico Magnocavallo Date: Sun, 31 Jul 2022 14:45:11 +0200 Subject: [PATCH 11/11] remove changelog workflow --- .github/workflows/merge-pr.yml | 58 ---------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 .github/workflows/merge-pr.yml diff --git a/.github/workflows/merge-pr.yml b/.github/workflows/merge-pr.yml deleted file mode 100644 index e9e0ee11..00000000 --- a/.github/workflows/merge-pr.yml +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: Post-merge tasks - -on: - pull_request: - branches: - - master - types: - - closed - workflow_dispatch: - inputs: - force: - description: "Force running from workflow dispatch." - required: false - type: boolean - -# permissions: -# contents: write -# pull-requests: read - -jobs: - if_merged: - if: github.event.pull_request.merged == true || ${{github.event.inputs.force}} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.10" - - name: Install dependencies - run: | - pip install -r tools/requirements.txt - - name: Update Changelog - run: | - python3 tools/changelog.py --token ${{ secrets.GITHUB_TOKEN }} CHANGELOG.md - - name: Commit and push Changelog - env: - CI_COMMIT_MESSAGE: Update Changelog - CI_COMMIT_AUTHOR: Fabric Repo Workflows - run: | - git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" - git config --global user.email "username@users.noreply.github.com" - git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}" - git push