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(core): Make Docker & CI affect everything #17078

Merged
merged 8 commits into from
Nov 29, 2024

Conversation

AndesKrrrrrrrrrrr
Copy link
Member

@AndesKrrrrrrrrrrr AndesKrrrrrrrrrrr commented Nov 28, 2024

Recent main outages have been caused by regressions in CI and Dockerfiles. These core components currently don't "affect" the applications, hence, the applications aren't built, tested, docker-built, etc. when they should be.

Hoping here to catch future regressions.

Summary by CodeRabbit

  • New Features

    • Enhanced build and testing configurations with the addition of new inputs for "DevOps," "CI," and "Dockerfiles."
    • Improved integration with GitHub actions and workflows.
  • Bug Fixes

    • Updated input paths to ensure proper targeting of relevant files and directories.

Copy link
Contributor

coderabbitai bot commented Nov 28, 2024

Walkthrough

The changes made in this pull request focus on modifying the nx.json configuration file. Key updates include the addition of the "DevOps" input to the build target's inputs and the introduction of new named inputs for "DevOps", "CI", and "Dockerfiles", specifying relevant file patterns and directories. Additionally, the targetDefaults section for test has been updated to include a new input for the Jest target. These modifications enhance the build and testing configurations.

Changes

File Change Summary
nx.json - Updated inputs in targetDefaults.build to include "DevOps".
- Added named inputs: "DevOps" (with dependencies on "CI" and "Dockerfiles"), "CI" (with paths to GitHub actions and Docker-related files), and "Dockerfiles" (for Dockerfile-related files).
- Modified targetDefaults.test to include "{workspaceRoot}/jest.preset.js" in inputs for @nx/jest:jest.

Possibly related PRs

Suggested reviewers

  • peturgq
  • svanaeinars

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between d7aa5ff and 7dc9212.

📒 Files selected for processing (1)
  • nx.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • nx.json

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

codecov bot commented Nov 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 35.68%. Comparing base (467e050) to head (7dc9212).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #17078   +/-   ##
=======================================
  Coverage   35.68%   35.68%           
=======================================
  Files        6941     6940    -1     
  Lines      147232   147226    -6     
  Branches    41863    41860    -3     
=======================================
+ Hits        52538    52540    +2     
+ Misses      94694    94686    -8     
Flag Coverage Δ
air-discount-scheme-backend 47.89% <ø> (ø)
air-discount-scheme-web 0.00% <ø> (ø)
api 3.34% <ø> (ø)
api-catalogue-services 77.85% <ø> (ø)
api-domains-air-discount-scheme 37.12% <ø> (ø)
api-domains-assets 26.71% <ø> (ø)
api-domains-auth-admin 48.49% <ø> (ø)
api-domains-communications 39.53% <ø> (ø)
api-domains-criminal-record 47.60% <ø> (ø)
api-domains-driving-license 44.52% <ø> (ø)
api-domains-education 30.61% <ø> (ø)
api-domains-health-insurance 34.48% <ø> (ø)
api-domains-mortgage-certificate 34.77% <ø> (ø)
api-domains-payment-schedule 41.34% <ø> (ø)
application-api-files 62.14% <ø> (ø)
application-core 70.60% <ø> (-0.32%) ⬇️
application-system-api 38.74% <ø> (+0.02%) ⬆️
application-template-api-modules 27.79% <ø> (ø)
application-templates-accident-notification 28.97% <ø> (ø)
application-templates-car-recycling 3.12% <ø> (ø)
application-templates-criminal-record 25.86% <ø> (ø)
application-templates-driving-license 18.18% <ø> (ø)
application-templates-estate 13.75% <ø> (ø)
application-templates-example-payment 24.80% <ø> (ø)
application-templates-financial-aid 15.80% <ø> (ø)
application-templates-general-petition 23.09% <ø> (ø)
application-templates-inheritance-report 6.57% <ø> (ø)
application-templates-marriage-conditions 15.12% <ø> (ø)
application-templates-mortgage-certificate 43.27% <ø> (ø)
application-templates-parental-leave 30.02% <ø> (+0.09%) ⬆️
application-types 6.51% <ø> (ø)
application-ui-components 1.27% <ø> (ø)
application-ui-shell 21.44% <ø> (ø)
auth-admin-web 2.43% <ø> (ø)
auth-nest-tools 31.10% <ø> (ø)
auth-react 24.40% <ø> (ø)
auth-shared 75.00% <ø> (ø)
clients-charge-fjs-v2 24.11% <ø> (ø)
clients-driving-license 40.32% <ø> (ø)
clients-driving-license-book 43.53% <ø> (ø)
clients-financial-statements-inao 49.10% <ø> (ø)
clients-license-client 1.26% <ø> (ø)
clients-middlewares 73.33% <ø> (ø)
clients-regulations 42.40% <ø> (ø)
clients-rsk-company-registry 29.76% <ø> (ø)
clients-rsk-personal-tax-return 38.00% <ø> (ø)
clients-smartsolutions 12.77% <ø> (ø)
clients-syslumenn 49.25% <ø> (ø)
clients-zendesk 50.73% <ø> (ø)
cms 0.40% <ø> (ø)
cms-translations 38.86% <ø> (ø)
content-search-index-manager 95.65% <ø> (ø)
content-search-toolkit 8.20% <ø> (ø)
contentful-apps 4.74% <ø> (ø)
dokobit-signing 62.85% <ø> (ø)
email-service 60.65% <ø> (ø)
feature-flags 90.69% <ø> (ø)
file-storage 45.91% <ø> (ø)
financial-aid-backend 51.30% <ø> (ø)
financial-aid-shared 17.81% <ø> (ø)
icelandic-names-registry-backend 54.34% <ø> (ø)
infra-nest-server 48.37% <ø> (ø)
infra-tracing 43.24% <ø> (ø)
island-ui-core 30.94% <ø> (ø)
judicial-system-api 20.36% <ø> (ø)
judicial-system-audit-trail 68.94% <ø> (ø)
judicial-system-formatters 79.58% <ø> (ø)
judicial-system-message 67.12% <ø> (ø)
judicial-system-message-handler 48.17% <ø> (ø)
judicial-system-scheduler 71.10% <ø> (ø)
judicial-system-types 42.79% <ø> (ø)
judicial-system-web 28.00% <ø> (ø)
license-api 42.58% <ø> (-0.02%) ⬇️
localization 10.15% <ø> (ø)
logging 48.43% <ø> (ø)
message-queue 68.87% <ø> (+0.73%) ⬆️
nest-audit 68.20% <ø> (ø)
nest-aws 53.04% <ø> (ø)
nest-config 78.07% <ø> (ø)
nest-core 43.54% <ø> (ø)
nest-feature-flags 51.15% <ø> (ø)
nest-problem 45.82% <ø> (ø)
nest-sequelize 94.44% <ø> (ø)
nest-swagger 51.71% <ø> (ø)
nova-sms 62.18% <ø> (ø)
portals-admin-regulations-admin 1.80% <ø> (ø)
portals-core 18.38% <ø> (ø)
regulations 16.78% <ø> (ø)
residence-history 85.00% <ø> (ø)
services-auth-delegation-api 58.55% <ø> (ø)
services-sessions 65.47% <ø> (-0.05%) ⬇️
services-university-gateway 49.24% <ø> (-0.12%) ⬇️
services-user-notification 46.69% <ø> (ø)
services-user-profile 56.82% <ø> (ø)
shared-components 29.13% <ø> (ø)
shared-form-fields 33.88% <ø> (ø)
shared-mocking 60.89% <ø> (ø)
shared-pii 92.85% <ø> (ø)
shared-problem 87.50% <ø> (ø)
shared-utils 27.69% <ø> (ø)
skilavottord-ws 24.14% <ø> (ø)
web 2.44% <ø> (ø)

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

see 3 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 467e050...7dc9212. Read the comment docs.

@datadog-island-is
Copy link

datadog-island-is bot commented Nov 28, 2024

Datadog Report

All test runs fef35f4 🔗

99 Total Test Services: 0 Failed, 91 Passed
🔻 Test Sessions change in coverage: 2 decreased, 191 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 22.23s N/A Link
air-discount-scheme-web 0 0 0 2 0 7.02s N/A Link
api 0 0 0 4 0 2.38s N/A Link
api-catalogue-services 0 0 0 23 0 8.9s N/A Link
api-domains-air-discount-scheme 0 0 0 6 0 15.93s N/A Link
api-domains-assets 0 0 0 3 0 9.53s N/A Link
api-domains-auth-admin 0 0 0 18 0 10.16s N/A Link
api-domains-communications 0 0 0 5 0 30.71s N/A Link
api-domains-criminal-record 0 0 0 5 0 8.25s N/A Link
api-domains-driving-license 0 0 0 23 0 27.81s N/A Link

🔻 Code Coverage Decreases vs Default Branch (2)

  • clients-middlewares - jest 75.74% (-0.2%) - Details
  • services-university-gateway - jest 45.11% (-0.03%) - Details

@AndesKrrrrrrrrrrr AndesKrrrrrrrrrrr marked this pull request as ready for review November 28, 2024 14:27
@AndesKrrrrrrrrrrr AndesKrrrrrrrrrrr requested a review from a team as a code owner November 28, 2024 14:27
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: 0

🧹 Outside diff range and nitpick comments (1)
nx.json (1)

155-163: Consider including additional Docker-related files

The current implementation provides good coverage of CI and Dockerfile changes. However, consider expanding the "Dockerfiles" input to include other Docker-related files.

Consider updating the "Dockerfiles" input:

 "Dockerfiles": [
   "{workspaceRoot}/**/Dockerfile",
-  "{workspaceRoot}/**/Dockerfile.*"
+  "{workspaceRoot}/**/Dockerfile.*",
+  "{workspaceRoot}/**/docker-compose*.yml",
+  "{workspaceRoot}/**/.dockerignore"
 ],
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 67c6a26 and 4f897cd.

📒 Files selected for processing (1)
  • nx.json (2 hunks)
🔇 Additional comments (3)
nx.json (3)

149-149: LGTM! Default inputs now include DevOps changes

Adding "DevOps" to default inputs ensures consistent tracking of CI/Docker changes across all targets, providing workspace-wide coverage.


98-98: LGTM! Build target now correctly tracks DevOps changes

The addition of "DevOps" to build inputs ensures that changes to CI/Docker files will trigger rebuilds of affected applications, directly addressing the PR objective.

Let's verify the build dependencies are correctly configured:

✅ Verification successful

Build target configuration is correctly set up for DevOps changes

The verification confirms that:

  1. The build target in nx.json correctly includes "DevOps" in its inputs
  2. "DevOps" is properly defined in namedInputs to include both CI and Dockerfile changes
  3. The configuration is consistently applied across the workspace

The changes will ensure that modifications to CI workflows and Dockerfiles trigger rebuilds of affected applications as intended.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify build dependencies configuration
# Check if the build target is properly configured to track DevOps changes

# Search for any other build configurations that might need similar updates
rg -g '*.json' '"build":\s*{' -A 5

Length of output: 124


Script:

#!/bin/bash
# Let's try a different approach to verify build configurations
# 1. Search for build configurations in JSON files
rg -g '*.json' '"build"' -A 5

# 2. Also verify the complete structure of nx.json to understand the full context
cat nx.json

# 3. Check for any other files that might reference DevOps configurations
rg -g '*.json' 'DevOps'

Length of output: 33827


Line range hint 98-163: Verify the complete dependency chain

The changes effectively ensure that CI and Docker changes affect applications. Let's verify the complete dependency chain is working as expected.

✅ Verification successful

Configuration verified: DevOps changes properly integrated into build chain

The verification confirms that:

  • The build target correctly includes "DevOps" in its inputs, ensuring Docker and CI changes trigger rebuilds
  • Dockerfile paths exist in multiple locations, validating the "Dockerfiles" named input
  • No conflicting configurations found (nx.json is the only config file with these settings)
  • The dependency chain is properly structured without circular dependencies
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the complete dependency chain
# Check if all necessary files are included in the dependency tracking

# Check for any project-specific nx configuration files that might override these settings
fd -e json -x grep -l "targetDefaults\|namedInputs" {}

# Verify no conflicting configurations exist
rg -g '*.json' '"DevOps":\s*\[' -C 5

Length of output: 437


Script:

#!/bin/bash
# Let's verify the complete chain by checking:
# 1. If build target correctly includes DevOps inputs
# 2. If there are no circular dependencies
# 3. If the paths in named inputs actually exist

# Check build target configuration
rg -g 'nx.json' '"build":\s*{' -A 5

# Check if the DevOps paths exist
fd -p '.github/actions/'
fd -p '.github/workflows/'
fd -p 'Dockerfile'

# Verify the inputs are properly referenced
rg -g 'nx.json' '"inputs":\s*\[.*"DevOps"' -C 2

Length of output: 543

@AndesKrrrrrrrrrrr AndesKrrrrrrrrrrr added automerge Merge this PR as soon as all checks pass deploy-feature Deploys features to dev test everything 💀 test & build everything 💀 labels Nov 28, 2024
Copy link
Contributor

Affected services are: air-discount-scheme-api,air-discount-scheme-backend,api,application-system-api,download-service,financial-aid-api,financial-aid-backend,financial-aid-open-api,github-actions-cache,icelandic-names-registry-backend,judicial-system-api,judicial-system-digital-mailbox-api,judicial-system-backend,judicial-system-message-handler,judicial-system-scheduler,judicial-system-xrd-api,license-api,reference-backend,regulations-admin-backend,services-auth-admin-api,services-auth-ids-api,services-auth-delegation-api,services-auth-personal-representative,services-auth-personal-representative-public,services-auth-public-api,services-bff,services-contentful-entry-tagger,services-documents,services-endorsements-api,services-form-system,services-search-indexer,services-sessions,services-university-gateway,services-user-notification,services-user-profile,services-xroad-collector,skilavottord-ws,air-discount-scheme-web,auth-admin-web,consultation-portal,contentful-apps,financial-aid-web-osk,financial-aid-web-veita,judicial-system-web,skilavottord-web,web,application-system-form,island-ui-storybook,portals-admin,service-portal,system-e2e,external-contracts-tests,
Feature deployment of your services will begin shortly. Your feature will be accessible here:
https://choredockerfile-affected-api-catalogue.dev01.devland.is/api
https://choredockerfile-affected-api.dev01.devland.is/download
https://choredockerfile-affected-application-callback-xrd.internal.dev01.devland.is/application-payment
https://choredockerfile-affected-application-callback-xrd.internal.dev01.devland.is/applications
https://choredockerfile-affected-application-payment-callback-xrd.internal.dev01.devland.is/application-payment
https://choredockerfile-affected-application-payment-callback-xrd.internal.dev01.devland.is/applications
https://choredockerfile-affected-beta.dev01.devland.is/
https://choredockerfile-affected-beta.dev01.devland.is/api
https://choredockerfile-affected-beta.dev01.devland.is/app/skilavottord/
https://choredockerfile-affected-beta.dev01.devland.is/app/skilavottord/api/graphql
https://choredockerfile-affected-beta.dev01.devland.is/minarsidur
https://choredockerfile-affected-beta.dev01.devland.is/samradsgatt
https://choredockerfile-affected-beta.dev01.devland.is/stjornbord
https://choredockerfile-affected-beta.dev01.devland.is/stjornbord/bff
https://choredockerfile-affected-beta.dev01.devland.is/umsoknir
https://choredockerfile-affected-license-api-xrd.internal.dev01.devland.is/
https://choredockerfile-affected-loftbru-cf.dev01.devland.is/
https://choredockerfile-affected-loftbru-cf.dev01.devland.is/api/graphql
https://choredockerfile-affected-loftbru-cf.dev01.devland.is/api/public
https://choredockerfile-affected-loftbru-cf.dev01.devland.is/api/swagger
https://choredockerfile-affected-loftbru.dev01.devland.is/
https://choredockerfile-affected-loftbru.dev01.devland.is/api/graphql
https://choredockerfile-affected-loftbru.dev01.devland.is/api/public
https://choredockerfile-affected-loftbru.dev01.devland.is/api/swagger
https://choredockerfile-affected-service-portal-api.internal.dev01.devland.is/
https://choredockerfile-affected-services-university-gateway.internal.dev01.devland.is/api
https://choredockerfile-affected-sessions-api.internal.dev01.devland.is/
https://choredockerfile-affected-ui.dev01.devland.is/

Deployed services: application-system-api,application-system-form,service-portal,service-portal-api,portals-admin,consultation-portal,api,web,xroad-collector,skilavottord-web,skilavottord-ws,services-documents,island-ui-storybook,download-service,icelandic-names-registry-backend,endorsement-system-api,air-discount-scheme-web,air-discount-scheme-backend,air-discount-scheme-api,regulations-admin-backend,external-contracts-tests,application-system-api-worker,license-api,services-sessions,services-sessions-worker,services-sessions-cleanup,services-university-gateway,services-university-gateway-worker,services-bff-portals-admin.
Excluded services: search-indexer-service,github-actions-cache,user-notification,user-notification-worker,user-notification-cleanup-worker,contentful-entry-tagger-service,contentful-apps

Copy link
Member

@busla busla left a comment

Choose a reason for hiding this comment

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

scripts/* should also be included

Copy link
Member

@eirikurn eirikurn left a comment

Choose a reason for hiding this comment

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

Approving with comment.

nx.json Outdated Show resolved Hide resolved
Copy link
Member

@busla busla left a comment

Choose a reason for hiding this comment

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

LGTM

@kodiakhq kodiakhq bot merged commit f1ac9e5 into main Nov 29, 2024
539 checks passed
@kodiakhq kodiakhq bot deleted the chore/dockerfile-affected branch November 29, 2024 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this PR as soon as all checks pass deploy-feature Deploys features to dev test everything 💀 test & build everything 💀
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants