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

feat(infrastructure): create new yt01 infrastructure environment #1290

Merged
merged 4 commits into from
Oct 15, 2024

Conversation

arealmaas
Copy link
Collaborator

@arealmaas arealmaas commented Oct 14, 2024

Description

Create a new infrastructure environment for the performance environment yt01

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)

Documentation

  • Documentation is updated (either in docs-directory, Altinnpedia or a separate linked PR in altinn-studio-docs., if applicable)

Summary by CodeRabbit

  • New Features

    • Introduced a CI/CD workflow for the yt01 environment, enabling automated deployments and version management.
    • Added the option to select yt01 as a deployment environment in manual workflow triggers.
  • Bug Fixes

    • Updated the environment parameter from 'soak' to 'yt01' to reflect the correct context.
  • Chores

    • Adjusted formatting for parameter definitions for better readability.

@arealmaas arealmaas requested review from a team as code owners October 14, 2024 11:26
Copy link
Contributor

coderabbitai bot commented Oct 14, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

This pull request introduces several changes related to the yt01 environment in Azure infrastructure. The .azure/infrastructure/yt01.bicepparam file is updated to change the environment parameter from 'soak' to 'yt01' and adjusts the formatting of the serviceBusSku parameter. A new CI/CD workflow file .github/workflows/ci-cd-yt01.yml is added to manage deployments for the yt01 environment, while the existing workflow .github/workflows/dispatch-infrastructure.yml is modified to include yt01 as a selectable environment option.

Changes

File Path Change Summary
.azure/infrastructure/yt01.bicepparam Updated environment parameter from 'soak' to 'yt01'; adjusted formatting of serviceBusSku properties.
.github/workflows/ci-cd-yt01.yml New CI/CD workflow for yt01 environment, includes jobs for checking changes, version retrieval, and deployment.
.github/workflows/dispatch-infrastructure.yml Added yt01 as an option in workflow_dispatch.inputs.environment.

Possibly related issues

  • Etablere YT-miljø #1258: The changes establish a new environment (yt01) for application/infrastructure, aligning with the issue's objective to create a new YT environment with specific integrations.

Possibly related PRs

Suggested reviewers

  • oskogstad: Suggested as a reviewer for this pull request.
  • MagnusSandgren: Suggested as a reviewer for this pull request.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between aa76695 and 6790262.

📒 Files selected for processing (1)
  • .github/workflows/ci-cd-yt01.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci-cd-yt01.yml
🧰 Additional context used
📓 Learnings (1)
📓 Common learnings
Learnt from: arealmaas
PR: digdir/dialogporten#1290
File: .github/workflows/dispatch-infrastructure.yml:13-13
Timestamp: 2024-10-14T13:53:04.880Z
Learning: In the workflow `.github/workflows/dispatch-infrastructure.yml`, the `environment` input is generic and used to select the correct GitHub secrets and `bicepparams`. Adding a new environment option like 'yt01' is sufficient without needing additional deployment steps or configurations.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (4)
.github/workflows/ci-cd-yt01.yml (4)

12-31: LGTM: Reusable workflows are well-implemented.

The use of reusable workflows for checking changes, getting the current version, and publishing is a good practice. The conditional execution of the publish job is efficient.

Consider adding a comment explaining the purpose of the GCR_PASSWORD secret, as it's not immediately clear why GITHUB_TOKEN is used for this.


33-49: LGTM: Infrastructure deployment job is well-structured.

The infrastructure deployment job is correctly set up with appropriate conditions, dependencies, and secrets for Azure authentication.

Consider using GitHub environments to manage environment-specific secrets and settings. This could simplify the workflow and improve secret management. For example:

deploy-infra-yt01:
  environment: yt01
  # ... other settings ...

This approach would allow you to store environment-specific secrets in GitHub and reference them directly in the workflow.


51-122: Future enhancements are well-planned.

The commented-out jobs provide a clear roadmap for future CI/CD pipeline enhancements, including app deployment, slack notifications, and e2e testing.

Consider adding a TODO comment at the top of the file or in the repository's README to track the planned implementation of these additional jobs. This will help team members understand the roadmap for this workflow.

Would you like me to draft a high-level TODO list for these future enhancements?


1-122: Overall, this is a well-structured and comprehensive CI/CD workflow.

The workflow for the yt01 environment is thoughtfully designed, incorporating best practices such as:

  • Use of reusable workflows
  • Conditional job execution
  • Proper secret management
  • Concurrency control

The implemented jobs provide a solid foundation for the CI/CD process, while the commented-out sections outline a clear roadmap for future enhancements.

As you continue to develop this workflow, consider the following suggestions:

  1. Implement the planned jobs incrementally, testing each addition thoroughly.
  2. Regularly review and update the secrets and environment variables used in the workflow.
  3. Consider setting up branch protection rules that require this workflow to pass before merging PRs.
  4. As the workflow grows, you might want to split it into multiple files for better maintainability.

Great job on setting up this robust CI/CD pipeline for the yt01 environment!

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 7267546 and aa76695.

📒 Files selected for processing (3)
  • .azure/infrastructure/yt01.bicepparam (1 hunks)
  • .github/workflows/ci-cd-yt01.yml (1 hunks)
  • .github/workflows/dispatch-infrastructure.yml (1 hunks)
🧰 Additional context used
🔇 Additional comments (3)
.azure/infrastructure/yt01.bicepparam (2)

Line range hint 20-46: Review SKU parameters for performance environment

While not directly changed in this PR, it's important to verify that the existing SKU parameters are appropriate for the new 'yt01' performance environment. Particularly, consider reviewing:

  1. keyVaultSku: Currently set to 'standard'. Ensure this meets the performance requirements.
  2. appConfigurationSku: Set to 'standard'. Verify if this is sufficient for the performance environment.
  3. serviceBusSku: Set to 'Premium' with capacity 1. Confirm if this capacity is adequate for expected performance testing loads.
  4. redisSku: Set to 'Basic' with capacity 1. For a performance environment, you might want to consider a higher tier or capacity.

To help with this review, let's compare these settings with other environments:

#!/bin/bash
# Description: Compare SKU settings across different environment files

# Test: Extract and compare SKU settings
echo "Comparing SKU settings across environments:"
for file in .azure/infrastructure/*.bicepparam; do
  echo "File: $file"
  rg -A 1 'param (\w+Sku)' "$file"
  echo "---"
done

Please review the results and consider adjusting the SKUs if necessary for the 'yt01' performance environment.


3-3: Environment parameter updated correctly.

The environment parameter has been updated from 'soak' to 'yt01', which aligns with the PR objective of creating a new yt01 infrastructure environment. This change is consistent with the comment from the previous review indicating not to use 'soak' for anything at the moment.

To ensure consistency across the infrastructure, let's verify if this change is reflected in other relevant files:

.github/workflows/ci-cd-yt01.yml (1)

1-11: LGTM: Workflow setup looks good.

The workflow name, triggers, and concurrency settings are well-defined and appropriate for a CI/CD pipeline targeting the yt01 environment.

.github/workflows/dispatch-infrastructure.yml Show resolved Hide resolved
knuhau
knuhau previously approved these changes Oct 15, 2024
Copy link

@arealmaas arealmaas merged commit 2044070 into main Oct 15, 2024
23 checks passed
@arealmaas arealmaas deleted the feat/perf-environment branch October 15, 2024 13:01
arealmaas pushed a commit that referenced this pull request Oct 15, 2024
🤖 I have created a release *beep* *boop*
---


##
[1.24.0](v1.23.2...v1.24.0)
(2024-10-15)


### Features

* **infrastructure:** create new yt01 infrastructure environment
([#1290](#1290))
([2044070](2044070))


### Bug Fixes

* Fallback to using list auth if details auth fails, remove double cache
([#1274](#1274))
([54425e7](54425e7))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
arealmaas added a commit that referenced this pull request Oct 17, 2024
<!--- Provide a general summary of your changes in the Title above -->

## Description

Dependent on #1290

<!--- Describe your changes in detail -->

## Related Issue(s)

- #1258 

## Verification

- [ ] **Your** code builds clean without any errors or warnings
- [ ] Manual testing done (required)
- [ ] Relevant automated test added (if you find this hard, leave it and
we'll help out)

## Documentation

- [ ] Documentation is updated (either in `docs`-directory, Altinnpedia
or a separate linked PR in
[altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if
applicable)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced new Bicep parameter files for various applications,
allowing for dynamic configuration based on environment variables.
- Added a `deploy-apps` job to the CI/CD workflow for streamlined
application deployment to the yt01 environment.
- Updated workflow dispatch options to include `yt01` as a selectable
environment.

- **Bug Fixes**
- Streamlined CI/CD configuration by removing commented-out sections for
clarity.

- **Documentation**
- Enhanced parameter definitions for better clarity in deployment
configurations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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.

2 participants