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

fix(native-app): Add typecheck to native app into our pipeline #14607

Merged
merged 56 commits into from
May 17, 2024

Conversation

snaerseljan
Copy link
Contributor

@snaerseljan snaerseljan commented Apr 24, 2024

Add typecheck to native app into our pipeline

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

  • Chores
    • Improved caching for NodeJS dependencies by adding additional directories.
    • Optimized GitHub Actions workflows for cache key calculations and preparation steps.
    • Enhanced type checking by updating the build command in the project configuration.

@coderabbitai ignore

@snaerseljan snaerseljan requested a review from a team as a code owner April 24, 2024 14:32
Copy link
Contributor

coderabbitai bot commented Apr 24, 2024

Walkthrough

The updates primarily focus on enhancing the caching mechanism for NodeJS dependencies in GitHub workflows. This includes modifying paths for node_modules caching, renaming cache keys, and introducing composite actions for cache preparation and key calculation. Additionally, a build command in the project configuration has been updated to ensure proper type checking.

Changes

File Path Change Summary
.github/workflows/pullrequest.yml Updated cache path to include apps/native/app/node_modules.
.github/workflows/config-values.yaml Changed path to composite action for caching NodeJS dependencies.
.github/workflows/push.yml Modified cache paths, renamed cache keys, removed and added steps for cache key calculations.
.github/actions/prepare-cache/action.yml Introduced a composite action for caching dependencies and setting up the environment.
.github/actions/calculate-cache-keys/action.yml Added a GitHub Action to calculate cache keys for node_modules, mobile app node_modules, and generated files.
apps/native/app/project.json Updated build command from yarn build-mock to yarn nx:typecheck.

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@snaerseljan snaerseljan added the automerge Merge this PR as soon as all checks pass label Apr 24, 2024
@snaerseljan snaerseljan requested a review from a team as a code owner April 24, 2024 15:07
.github/workflows/pullrequest.yml Outdated Show resolved Hide resolved
.github/workflows/push.yml Outdated Show resolved Hide resolved
@busla busla force-pushed the native-app-ci-cd-typecheck branch from 18497f8 to 8736bc5 Compare April 26, 2024 14:07
@snaerseljan snaerseljan requested a review from a team as a code owner April 26, 2024 14:34
@datadog-island-is
Copy link

datadog-island-is bot commented Apr 26, 2024

Datadog Report

All test runs 96069bb 🔗

5 Total Test Services: 0 Failed, 5 Passed
➡️ Test Sessions change in coverage: 11 no change

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
api 0 0 0 4 0 3.4s 1 no change Link
application-system-api 0 0 0 111 2 3m 16.39s 1 no change Link
application-template-api-modules 0 0 0 109 0 2m 23.5s 1 no change Link
application-ui-shell 0 0 0 74 0 1m 9.65s 1 no change Link
download-service 0 0 0 1 0 23.8s 1 no change Link

Copy link

codecov bot commented Apr 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.91%. Comparing base (c83a658) to head (7c4c288).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##             main   #14607    +/-   ##
========================================
  Coverage   36.91%   36.91%            
========================================
  Files        6327     6327            
  Lines      128886   128886            
  Branches    36776    36643   -133     
========================================
  Hits        47574    47574            
  Misses      81312    81312            
Flag Coverage Δ
api 3.48% <ø> (ø)
application-system-api 41.96% <ø> (ø)
application-template-api-modules 24.39% <ø> (+<0.01%) ⬆️
application-templates-inheritance-report 3.95% <ø> (ø)
application-ui-shell 21.72% <ø> (ø)
download-service 44.37% <ø> (ø)

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


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 c83a658...7c4c288. Read the comment docs.

@snaerseljan snaerseljan requested a review from lodmfjord April 30, 2024 10:03
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: 4

Out of diff range and nitpick comments (1)
.github/actions/prepare-cache/action.yml (1)

1-2: Ensure the description is detailed enough to understand the action's purpose.

Consider enhancing the description to provide more specific details about what dependencies are cached and how the environment is set up. This will help future developers understand the action's purpose more clearly.

.github/actions/prepare-cache/action.yml Outdated Show resolved Hide resolved
.github/actions/prepare-cache/action.yml Outdated Show resolved Hide resolved
.github/actions/prepare-cache/action.yml Outdated Show resolved Hide resolved
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

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 447b023 and 8137ec3.
Files selected for processing (1)
  • .github/actions/prepare-cache/action.yml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/actions/prepare-cache/action.yml

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

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 8137ec3 and 16e022c.
Files selected for processing (1)
  • .github/actions/prepare-cache/action.yml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/actions/prepare-cache/action.yml

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

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 16e022c and afdb771.
Files selected for processing (1)
  • .github/actions/calculate-cache-keys/action.yml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/actions/calculate-cache-keys/action.yml

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

Out of diff range and nitpick comments (1)
.github/workflows/push.yml (1)

278-298: The introduction of the calculate-cache-keys action and its usage in the caching steps is a significant improvement. It centralizes the cache key generation, which can help avoid discrepancies and errors in key generation across different jobs or steps.

Consider documenting the specific hash functions or methods used in the calculate-cache-keys action to ensure clarity and maintainability.

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between afdb771 and fc7b39a.
Files selected for processing (1)
  • .github/workflows/push.yml (6 hunks)
Additional comments not posted (4)
.github/workflows/push.yml (4)

165-167: Ensure the new cache keys are correctly utilized in subsequent steps.


336-348: The separation of cache preparation for Docker layers is a good practice as it allows for more granular control and optimization of the caching process specific to Docker builds.


421-437: The repetition of cache preparation steps in different jobs (like tests and docker-build) is necessary due to the scope of job outputs in GitHub Actions. However, ensure that the cache keys are consistently applied across all instances to prevent any cache miss due to key mismatches.


484-513: The handling of cache in the docker-build job, especially with the conditional checks (if: steps.gather.outcome == 'success'), ensures that caching operations are only performed when the preliminary steps are successful, thus avoiding unnecessary operations on failed builds.

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

Out of diff range and nitpick comments (1)
.github/actions/prepare-cache/action.yml (1)

49-77: Consider increasing the threshold for cache validity checks.

The current threshold of 1000 bytes might be too low for node_modules and generated_files.tar.gz. Consider setting a more realistic size threshold to ensure meaningful cache validation.

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between fc7b39a and 8d9fe46.
Files selected for processing (1)
  • .github/actions/prepare-cache/action.yml (1 hunks)
Additional comments not posted (3)
.github/actions/prepare-cache/action.yml (3)

20-47: Cache preparation and checking steps are correctly implemented.


101-113: Building dependencies and running code generation steps are well-implemented.


122-139: Output gathering step is correctly implemented.

.github/actions/prepare-cache/action.yml Show resolved Hide resolved
.github/actions/prepare-cache/action.yml Show resolved Hide resolved
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

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 8d9fe46 and 8c6ba68.
Files selected for processing (1)
  • .github/workflows/push.yml (6 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/push.yml

@busla
Copy link
Member

busla commented May 17, 2024

@coderabbitai resolve

Copy link
Contributor

coderabbitai bot commented May 17, 2024

Actions Performed

Comments resolved and changes approved.

@busla busla merged commit fdb0884 into main May 17, 2024
41 checks passed
@busla busla deleted the native-app-ci-cd-typecheck branch May 17, 2024 16:09
busla added a commit that referenced this pull request May 17, 2024
busla added a commit that referenced this pull request May 17, 2024
@lodmfjord lodmfjord restored the native-app-ci-cd-typecheck branch May 30, 2024 15:51
@coderabbitai coderabbitai bot mentioned this pull request Dec 2, 2024
6 tasks
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants