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

chore: Feature deploy with ArgoCD #17610

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

chore: Feature deploy with ArgoCD #17610

wants to merge 1 commit into from

Conversation

peturgq
Copy link
Member

@peturgq peturgq commented Jan 22, 2025

...

Attach a link to issue if relevant

What

Specify what you're trying to achieve

Why

Specify why you need to achieve this

Screenshots / Gifs

Attach Screenshots / Gifs to help reviewers understand the scope of the pull request

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

Summary by CodeRabbit

  • New Features
    • Enhanced GitHub Actions workflow with a new feature deployment job
  • Improvements
    • Refined deployment process to support feature-specific deployments
    • Added conditional logic to control deployment workflows
    • Improved deployment flexibility and granular control

@peturgq peturgq requested a review from a team as a code owner January 22, 2025 13:12
Copy link
Contributor

coderabbitai bot commented Jan 22, 2025

Walkthrough

The pull request introduces a new deploy-feature job to the GitHub Actions workflow in .github/workflows/push.yml. This job is designed to handle feature deployments with specific conditions, including successful completion of previous jobs and specific pre-check outputs. The workflow modification allows for more granular control over deployment processes, enabling a distinct path for feature deployments while preventing conflicts with the standard deployment job.

Changes

File Change Summary
.github/workflows/push.yml - Added new deploy-feature job
- Modified existing deploy job to prevent running during feature deployments
- Introduced conditional logic for feature deployment workflow

Sequence Diagram

sequenceDiagram
    participant PC as Pre-Checks
    participant HB as Helm-Docker-Build
    participant DF as Deploy-Feature
    participant D as Deploy

    PC->>PC: Check Deployment Type
    PC-->>HB: Trigger Build
    HB-->>DF: Conditional Execution
    alt Feature Deployment
        DF->>DF: Generate ArgoCD Charts
        DF->>DF: Commit and Push
    else Standard Deployment
        D->>D: Standard Deployment Process
    end
Loading

Possibly related PRs

Suggested labels

deploy-feature, automerge

Suggested reviewers

  • robertaandersen
  • busla

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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: 2

🧹 Nitpick comments (1)
.github/workflows/push.yml (1)

779-781: Consider using environment variables for git configuration.

Instead of hardcoding the git user and email, consider using environment variables:

-          git config user.name andes-it
-          git config user.email [email protected]
+          git config user.name "${GIT_AUTHOR_NAME:-andes-it}"
+          git config user.email "${GIT_AUTHOR_EMAIL:[email protected]}"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bb52c30 and a3d7fbc.

📒 Files selected for processing (1)
  • .github/workflows/push.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/push.yml

724-724: label "ec2-runners" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


754-754: property "infra-node-modules-hash" is not defined in object type {build_chunks: string; cache_keys: string; docker_tag: string; images: string; last_good_build_docker_tag: string; node-modules-hash: string; node_image_tag: string; test_chunks: string; unaffected: string}

(expression)


767-767: shellcheck reported issue in this script: SC2086:info:1:68: Double quote to prevent globbing and word splitting

(shellcheck)


767-767: shellcheck reported issue in this script: SC2086:info:1:217: Double quote to prevent globbing and word splitting

(shellcheck)


767-767: shellcheck reported issue in this script: SC2086:info:2:165: Double quote to prevent globbing and word splitting

(shellcheck)


785-785: label "ec2-runners" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)

🔇 Additional comments (2)
.github/workflows/push.yml (2)

723-737: Review job execution conditions.

The job conditions are complex but well-structured, ensuring the job only runs when:

  • Pre-checks are successful
  • It's a feature deployment
  • Not a pre-release
  • Helm docker build hasn't failed
  • There are images to deploy
🧰 Tools
🪛 actionlint (1.7.4)

724-724: label "ec2-runners" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


788-788: LGTM! Well-structured deployment conditions.

The condition correctly ensures that the regular deploy job doesn't run when feature deployment is active, preventing potential conflicts.

Comment on lines +742 to +747
- name: Checkout feature-values
uses: actions/checkout@v4
with:
repository: island-is/feature-values
token: ${{ secrets.DIRTY_FIX_BOT_TOKEN }}
path: feature-values
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider replacing DIRTY_FIX_BOT_TOKEN with a properly scoped token.

The token name suggests this might be a temporary solution. Consider:

  1. Creating a dedicated GitHub App or service account
  2. Using the minimum required permissions
  3. Renaming the secret to reflect its purpose (e.g., FEATURE_VALUES_REPO_TOKEN)

Comment on lines +767 to +769
run: |
./monorepo/infra/scripts/generate-feature-values.sh jobs --feature $FEATURE_NAME --images "$IMAGES" --chart islandis --jobImage "821090935708.dkr.ecr.eu-west-1.amazonaws.com/helm-config:$DOCKER_TAG" > feature-values/$FEATURE_NAME-job-manifest.yaml
./monorepo/infra/scripts/generate-feature-values.sh values --chart islandis --feature "$FEATURE_NAME" --images "$IMAGES" --dockertag "$DOCKER_TAG" > feature-values/$FEATURE_NAME.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix shell script quoting issues.

The generate-feature-values.sh calls have potential word splitting issues.

Apply this diff to fix the quoting:

-./monorepo/infra/scripts/generate-feature-values.sh jobs --feature $FEATURE_NAME --images "$IMAGES" --chart islandis --jobImage "821090935708.dkr.ecr.eu-west-1.amazonaws.com/helm-config:$DOCKER_TAG" > feature-values/$FEATURE_NAME-job-manifest.yaml
-./monorepo/infra/scripts/generate-feature-values.sh values --chart islandis --feature "$FEATURE_NAME" --images "$IMAGES" --dockertag "$DOCKER_TAG" > feature-values/$FEATURE_NAME.yaml
+./monorepo/infra/scripts/generate-feature-values.sh jobs --feature "$FEATURE_NAME" --images "$IMAGES" --chart "islandis" --jobImage "821090935708.dkr.ecr.eu-west-1.amazonaws.com/helm-config:$DOCKER_TAG" > "feature-values/$FEATURE_NAME-job-manifest.yaml"
+./monorepo/infra/scripts/generate-feature-values.sh values --chart "islandis" --feature "$FEATURE_NAME" --images "$IMAGES" --dockertag "$DOCKER_TAG" > "feature-values/$FEATURE_NAME.yaml"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
run: |
./monorepo/infra/scripts/generate-feature-values.sh jobs --feature $FEATURE_NAME --images "$IMAGES" --chart islandis --jobImage "821090935708.dkr.ecr.eu-west-1.amazonaws.com/helm-config:$DOCKER_TAG" > feature-values/$FEATURE_NAME-job-manifest.yaml
./monorepo/infra/scripts/generate-feature-values.sh values --chart islandis --feature "$FEATURE_NAME" --images "$IMAGES" --dockertag "$DOCKER_TAG" > feature-values/$FEATURE_NAME.yaml
run: |
./monorepo/infra/scripts/generate-feature-values.sh jobs --feature "$FEATURE_NAME" --images "$IMAGES" --chart "islandis" --jobImage "821090935708.dkr.ecr.eu-west-1.amazonaws.com/helm-config:$DOCKER_TAG" > "feature-values/$FEATURE_NAME-job-manifest.yaml"
./monorepo/infra/scripts/generate-feature-values.sh values --chart "islandis" --feature "$FEATURE_NAME" --images "$IMAGES" --dockertag "$DOCKER_TAG" > "feature-values/$FEATURE_NAME.yaml"
🧰 Tools
🪛 actionlint (1.7.4)

767-767: shellcheck reported issue in this script: SC2086:info:1:68: Double quote to prevent globbing and word splitting

(shellcheck)


767-767: shellcheck reported issue in this script: SC2086:info:1:217: Double quote to prevent globbing and word splitting

(shellcheck)


767-767: shellcheck reported issue in this script: SC2086:info:2:165: Double quote to prevent globbing and word splitting

(shellcheck)

Copy link

codecov bot commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 35.61%. Comparing base (5f81d55) to head (a3d7fbc).
Report is 23 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #17610      +/-   ##
==========================================
+ Coverage   35.59%   35.61%   +0.01%     
==========================================
  Files        7027     7030       +3     
  Lines      150376   150997     +621     
  Branches    42920    43173     +253     
==========================================
+ Hits        53522    53773     +251     
- Misses      96854    97224     +370     
Flag Coverage Δ
air-discount-scheme-backend 48.15% <ø> (-0.11%) ⬇️
air-discount-scheme-web 0.00% <ø> (ø)
api 3.33% <ø> (ø)
api-catalogue-services 75.81% <ø> (ø)
api-domains-air-discount-scheme 37.90% <ø> (-0.24%) ⬇️
api-domains-assets 26.71% <ø> (ø)
api-domains-auth-admin 48.49% <ø> (ø)
api-domains-communications 39.49% <ø> (-0.04%) ⬇️
api-domains-criminal-record 47.81% <ø> (-0.31%) ⬇️
api-domains-education 31.09% <ø> (-0.26%) ⬇️
api-domains-health-insurance 35.19% <ø> (-0.38%) ⬇️
api-domains-mortgage-certificate 34.96% <ø> (-0.22%) ⬇️
api-domains-payment-schedule 42.04% <ø> (-0.23%) ⬇️
application-api-files 61.80% <ø> (-0.27%) ⬇️
application-core 75.68% <ø> (ø)
application-system-api 38.67% <ø> (-0.01%) ⬇️
application-template-api-modules 27.57% <ø> (+<0.01%) ⬆️
application-templates-accident-notification 27.60% <ø> (ø)
application-templates-car-recycling 3.12% <ø> (ø)
application-templates-criminal-record 25.79% <ø> (ø)
application-templates-driving-license 18.15% <ø> (ø)
application-templates-estate 13.58% <ø> (-0.01%) ⬇️
application-templates-example-payment 24.66% <ø> (ø)
application-templates-financial-aid 14.92% <ø> (+0.30%) ⬆️
application-templates-general-petition 23.11% <ø> (ø)
application-templates-inheritance-report 6.59% <ø> (ø)
application-templates-marriage-conditions 14.80% <ø> (ø)
application-templates-mortgage-certificate 43.73% <ø> (ø)
application-templates-new-primary-school 21.02% <ø> (ø)
application-templates-parental-leave 29.92% <ø> (ø)
application-types 6.47% <ø> (ø)
application-ui-components 1.17% <ø> (ø)
application-ui-shell 22.00% <ø> (-0.02%) ⬇️
auth-admin-web 2.43% <ø> (ø)
auth-nest-tools 31.69% <ø> (ø)
auth-shared 75.00% <ø> (ø)
clients-charge-fjs-v2 28.88% <ø> (ø)
clients-driving-license 40.68% <ø> (-0.31%) ⬇️
clients-driving-license-book 43.75% <ø> (-0.23%) ⬇️
clients-financial-statements-inao 49.48% <ø> (-0.30%) ⬇️
clients-license-client 1.26% <ø> (ø)
clients-middlewares 73.39% <ø> (+0.24%) ⬆️
clients-regulations 42.75% <ø> (-0.34%) ⬇️
clients-rsk-company-registry 31.18% <ø> (ø)
clients-rsk-personal-tax-return 38.32% <ø> (ø)
clients-smartsolutions 12.77% <ø> (ø)
clients-syslumenn 49.18% <ø> (-0.17%) ⬇️
clients-zendesk 49.88% <ø> (-0.94%) ⬇️
cms 0.39% <ø> (-0.01%) ⬇️
cms-translations 38.82% <ø> (-0.04%) ⬇️
content-search-index-manager 95.65% <ø> (ø)
content-search-toolkit 8.16% <ø> (ø)
contentful-apps 4.56% <ø> (ø)
dokobit-signing 61.66% <ø> (-0.70%) ⬇️
email-service 59.68% <ø> (-0.64%) ⬇️
feature-flags 90.40% <ø> (-0.58%) ⬇️
file-storage 45.32% <ø> (-0.86%) ⬇️
financial-aid-backend 51.38% <ø> (-0.11%) ⬇️
financial-aid-shared 17.88% <ø> (ø)
infra-nest-server 48.06% <ø> (ø)
infra-tracing 69.94% <ø> (ø)
island-ui-core 30.32% <ø> (ø)
judicial-system-api 20.07% <ø> (ø)
judicial-system-message 66.29% <ø> (-0.50%) ⬇️
judicial-system-message-handler 47.89% <ø> (-0.70%) ⬇️
judicial-system-scheduler 71.24% <ø> (-0.19%) ⬇️
judicial-system-types 37.77% <ø> (ø)
judicial-system-web 27.97% <ø> (-0.12%) ⬇️
localization 10.15% <ø> (ø)
logging 58.02% <ø> (ø)
message-queue 67.05% <ø> (-0.71%) ⬇️
nest-audit 65.78% <ø> (ø)
nest-aws 51.93% <ø> (ø)
nest-config 76.05% <ø> (-0.53%) ⬇️
nest-core 53.16% <ø> (ø)
nest-feature-flags 50.69% <ø> (-0.50%) ⬇️
nest-problem 45.64% <ø> (ø)
nest-sequelize 94.44% <ø> (ø)
nest-swagger 51.13% <ø> (ø)
nova-sms 60.96% <ø> (-0.74%) ⬇️
portals-admin-regulations-admin 1.80% <ø> (ø)
portals-core 19.60% <ø> (ø)
regulations 16.78% <ø> (ø)
residence-history 85.00% <ø> (ø)
services-auth-admin-api 52.47% <ø> (-0.04%) ⬇️
services-auth-delegation-api 58.47% <ø> (-0.04%) ⬇️
services-auth-ids-api 52.52% <ø> (-0.04%) ⬇️
services-auth-public-api 49.36% <ø> (-0.04%) ⬇️
services-sessions 65.33% <ø> (-0.13%) ⬇️
services-university-gateway 49.55% <ø> (-0.03%) ⬇️
services-user-notification 46.53% <ø> (-0.04%) ⬇️
services-user-profile 56.85% <ø> (-0.15%) ⬇️
shared-components 29.47% <ø> (ø)
shared-form-fields 33.36% <ø> (-0.02%) ⬇️
shared-mocking 58.64% <ø> (ø)
shared-pii 92.85% <ø> (ø)
shared-problem 87.50% <ø> (ø)
shared-utils 28.67% <ø> (ø)
skilavottord-ws 23.97% <ø> (ø)
web 2.39% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 170 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5f81d55...a3d7fbc. Read the comment docs.

@datadog-island-is
Copy link

datadog-island-is bot commented Jan 22, 2025

Datadog Report

All test runs 92a5558 🔗

10 Total Test Services: 0 Failed, 9 Passed
🔻 Test Sessions change in coverage: 4 decreased, 3 increased, 193 no change

Test Services
This report shows up to 10 services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
air-discount-scheme-backend 0 0 0 63 0 27.77s N/A Link
air-discount-scheme-web 0 0 0 2 0 6.85s N/A Link
api 0 0 0 4 0 2.47s N/A Link
api-catalogue-services 0 0 0 23 0 9.58s N/A Link
api-domains-air-discount-scheme 0 0 0 6 0 18.73s N/A Link
api-domains-license-service 0 0 0 0 0 562.91ms N/A Link
application-api-files 0 0 0 2 0 4.54s N/A Link
application-core 0 0 0 97 0 14.33s N/A Link
application-system-api 0 0 0 46 0 2m 13.67s 1 no change Link
application-template-api-modules 0 0 0 118 0 1m 36.18s 1 decreased (-0.01%) Link

🔻 Code Coverage Decreases vs Default Branch (4)

  • message-queue - jest 67.46% (-0.8%) - Details
  • clients-middlewares - jest 75.67% (-0.09%) - Details
  • license-api - jest 34.1% (-0.03%) - Details
  • application-template-api-modules - jest 30.02% (-0.01%) - Details

@peturgq peturgq added deploy-feature Deploys features to dev and removed deploy-feature Deploys features to dev labels Jan 22, 2025
Copy link
Contributor

Affected services are:
Feature deployment of your services will begin shortly. Your feature will be accessible here:

Deployed services: .
Excluded services: ``

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy-feature Deploys features to dev
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant