-
Notifications
You must be signed in to change notification settings - Fork 0
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
[DEVEX-179] Add a TF module to make mono-repository setup easier #148
base: main
Are you sure you want to change the base?
Conversation
|
infra/modules/azure_monorepo_single_env_starter_pack/variables.tf
Outdated
Show resolved
Hide resolved
infra/modules/azure_monorepo_single_env_starter_pack/container_app_job_runner.tf
Show resolved
Hide resolved
infra/modules/azure_monorepo_single_env_starter_pack/container_app_job_runner.tf
Show resolved
Hide resolved
infra/modules/azure_monorepo_single_env_starter_pack/github_branch_rules.tf
Show resolved
Hide resolved
pattern = "main" | ||
|
||
required_status_checks { | ||
strict = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any value in having the branch up to date before merging as CI pipelines run over the merge commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you elaborate a little bit more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we're talking about monorepository (aka a single, potentially large repository), there is an high possibility that PR's branch is not up to date with main
as other people are working on the same code base. I don't see this as an issue because the delta does not affect the validity of CI checks nor "manual" review as changes are on different paths. On the other hand, if changes are on the same files it is likely to have conflicts and PR cannot be merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's see what @pagopa/engineering-team-devex thinks about this
infra/modules/azure_monorepo_single_env_starter_pack/github_branch_rules.tf
Outdated
Show resolved
Hide resolved
infra/modules/azure_monorepo_single_env_starter_pack/github_branch_rules.tf
Show resolved
Hide resolved
infra/modules/azure_monorepo_single_env_starter_pack/github_branch_rules.tf
Outdated
Show resolved
Hide resolved
infra/modules/azure_monorepo_single_env_starter_pack/github_environments_cd.tf
Show resolved
Hide resolved
infra/modules/azure_monorepo_single_env_starter_pack/github_environments_cd.tf
Show resolved
Hide resolved
infra/modules/azure_monorepo_single_env_starter_pack/github_environments_cd.tf
Outdated
Show resolved
Hide resolved
infra/modules/azure_monorepo_single_env_starter_pack/github_repository.tf
Show resolved
Hide resolved
advanced_security { | ||
status = "enabled" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should add a validation to set required tags (team name / domain)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain it a little more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean: tags shouldn't ever be an empty map, but contains at least the team / domain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which tags? I don't follow you :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the usual ones Owner
, Source
, ... aren't required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor improvements
ccc23f3
to
ceee0f6
Compare
a8000be
to
9d2f315
Compare
List of changes
This PR adds a new Terraform module with to make the mono-repository setup a little more simpler.
This module includes:
If a team needs more resource groups, they can be defined into the
resources
configuration. However, all roles on that scope must be defined in there as well.What is missing:
GitHub repository and its configuration is not in this module. This because is still difficult to import the repository inside the Terraform state file at the stage of the first apply.
Few alternative approaches:
Constraints:
Versions constraints are intentionally high.
Azurerm pretends >= v4
Terraform versions should be >= 1.9.x
Requirements:
Before using this module, team must ensure to have at least two AD groups (admins, devs and eventually externals) with different subscription roles
Motivation and context
Two main reasons brought the creation of this module:
Moreover, it avoids manual setup for "apps" and "opex" managed identities as the actual module uses "infra" roles as defaults.
Why now?
Patterns and needs are clearer now, then making assumptions is easier
Type of changes
Does this introduce a change to production resources with possible user impact?
Other information