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: remove postinstall script #14352

Merged
merged 6 commits into from
Apr 10, 2024
Merged

chore: remove postinstall script #14352

merged 6 commits into from
Apr 10, 2024

Conversation

busla
Copy link
Member

@busla busla commented Apr 3, 2024

  • added infra cmd to install infra deps, yarn infra.
  • removed postinstall and postinstall.js script, doesn't work in yarn v3
  • yarn cli will now run scripts in infra

Summary by CodeRabbit

  • Documentation
    • Updated the command for setting up test mocking services in the system-e2e README.
  • Chores
    • Reorganized and simplified scripts in package.json, including the introduction of a new cli script and deprecation of the schemas script in favor of yarn codegen. Removed the postinstall script.
  • New Features
    • Introduced functionality for managing infrastructure commands using yargs and winston for logging in the new scripts/infra-cmds.js file. Includes commands for installing infrastructure dependencies and running various scripts defined in the package.json of the infrastructure module. Provides a warning message for deprecated usage.

@busla busla requested review from a team as code owners April 3, 2024 16:36
Copy link
Contributor

coderabbitai bot commented Apr 3, 2024

Walkthrough

The recent update involves refining the setup for test mocking services and reorganizing scripts within the project to streamline the development process. Notably, the test mocking setup command has been updated, and significant changes have been made to scripts in package.json. Additionally, a new file scripts/infra-cmds.js has been introduced to manage infrastructure commands efficiently.

Changes

File(s) Summary of Changes
package.json Reorganized scripts related to charts, infra, and cli. Introduced cli script, simplified charts, included install in infra, removed postinstall, and deprecated schemas in favor of yarn codegen.
scripts/infra-cmds.js Introduced scripts/infra-cmds.js for managing infrastructure commands using yargs and winston, providing commands for installing dependencies and running scripts from package.json. Dynamic loading of commands and warning for deprecated usage included.

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.

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

Review Status

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between 232268b and 83129cc.
Files selected for processing (2)
  • apps/system-e2e/README.md (1 hunks)
  • package.json (1 hunks)
Additional Context Used
Path-based Instructions (1)
apps/system-e2e/README.md (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
Additional comments not posted (3)
package.json (3)

59-59: Assuming yarn charts is a valid command, this simplification aligns with the objective to streamline script execution.


60-60: The modification of the infra script to include install aligns with the PR's objective to streamline the installation of infrastructure dependencies.


61-61: Introducing a new cli script effectively consolidates script execution through a single entry point, simplifying the development process.

apps/system-e2e/README.md Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
apps/system-e2e/README.md Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@saevarma
Copy link
Member

saevarma commented Apr 4, 2024

This is missing clean up of

If you want run codegen on every install you can set the environment variable RUN_CODEGEN_ON_INSTALL=true. Note that this will run codegen when rebuilding the workspace in the post-install phase, with no output, so the install script seems to hang.

in the root readme and docs.devland.
But see the slack thread about discussion about cleaning up the root readme more and let this guide live in docs.devland.

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

Review Status

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between 83129cc and f10b9f7.
Files selected for processing (2)
  • package.json (1 hunks)
  • scripts/infra-cmds.js (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • package.json
Additional Context Used
Path-based Instructions (1)
scripts/infra-cmds.js (1)

Pattern scripts/**/*: "Confirm that the code adheres to the following:

  • Script efficiency, readability, and maintainability.
  • Usage of environmental variables and configuration files for flexibility.
  • Integration with NX workspace utilities and commands."
Additional comments not posted (2)
scripts/infra-cmds.js (2)

22-36: The custom formatting and logger setup using winston are correctly implemented and follow best practices.


44-46: Consider the security implications of using spawn with shell: true.
While the current usage seems safe, ensure that arguments passed to spawn are sanitized to prevent command injection vulnerabilities.

Also applies to: 70-72

scripts/infra-cmds.js Outdated Show resolved Hide resolved
Copy link

codecov bot commented Apr 4, 2024

Codecov Report

Merging #14352 (4a377de) into main (efa5b4a) will decrease coverage by 0.23%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #14352      +/-   ##
==========================================
- Coverage   37.16%   36.94%   -0.23%     
==========================================
  Files        6155     6139      -16     
  Lines      123889   124137     +248     
  Branches    35378    35491     +113     
==========================================
- Hits        46049    45864     -185     
- Misses      77840    78273     +433     
Flag Coverage Δ
application-templates-general-petition 19.03% <ø> (ø)
application-templates-health-insurance 23.03% <ø> (ø)
application-templates-inheritance-report 4.17% <ø> (+3.10%) ⬆️
auth-admin-web 2.43% <ø> (ø)
auth-api-lib 10.64% <ø> (+0.05%) ⬆️
auth-nest-tools 29.14% <ø> (ø)
clients-license-client 1.84% <ø> (-0.06%) ⬇️
clients-middlewares 73.24% <ø> (-0.28%) ⬇️
clients-rsk-company-registry 30.49% <ø> (ø)
clients-rsk-personal-tax-return 38.00% <ø> (ø)
clients-smartsolutions 12.77% <ø> (ø)
clients-syslumenn 48.55% <ø> (+0.05%) ⬆️
clients-zendesk 55.26% <ø> (ø)
content-search-index-manager 95.65% <ø> (ø)
content-search-toolkit 8.59% <ø> (-0.05%) ⬇️
dokobit-signing 60.34% <ø> (+0.19%) ⬆️
judicial-system-formatters 82.78% <ø> (+0.19%) ⬆️
nest-audit 68.20% <ø> (ø)
nest-config 77.20% <ø> (+0.06%) ⬆️
portals-admin-regulations-admin 2.15% <ø> (ø)
portals-core 16.14% <ø> (-0.04%) ⬇️
services-auth-admin-api 51.83% <ø> (ø)
services-auth-delegation-api 62.51% <ø> (ø)
services-auth-ids-api 56.16% <ø> (ø)
services-auth-personal-representative 51.00% <ø> (ø)
services-auth-personal-representative-public 46.48% <ø> (+0.06%) ⬆️
services-auth-public-api 51.55% <ø> (ø)
services-documents 60.89% <ø> (ø)
services-endorsements-api 54.80% <ø> (+0.01%) ⬆️
services-sessions 65.52% <ø> (+0.01%) ⬆️
services-university-gateway 49.50% <ø> (-0.62%) ⬇️
services-user-notification 47.03% <ø> (ø)
shared-utils 27.66% <ø> (ø)

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

see 118 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 efa5b4a...4a377de. Read the comment docs.

Copy link
Member

@saevarma saevarma left a comment

Choose a reason for hiding this comment

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

🚀

busla and others added 2 commits April 5, 2024 00:26
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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 Status

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between f10b9f7 and 452a0ca.
Files selected for processing (1)
  • scripts/infra-cmds.js (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • scripts/infra-cmds.js

@datadog-island-is
Copy link

datadog-island-is bot commented Apr 5, 2024

Datadog Report

All test runs 6447f90 🔗

73 Total Test Services: 0 Failed, 73 Passed

Test Services
This report shows up to 10 services
Service Name Failed Known Flaky New Flaky Passed Skipped Wall Time Test Service View
air-discount-scheme-backend 0 0 0 70 0 4.78s Link
air-discount-scheme-web 0 0 0 2 0 12.17ms Link
api-catalogue-services 0 0 0 23 0 1.13s Link
api-domains-air-discount-scheme 0 0 0 6 0 193.8ms Link
api-domains-assets 0 0 0 3 0 21.53ms Link
api-domains-communications 0 0 0 5 0 129.74ms Link
api-domains-criminal-record 0 0 0 5 0 125.11ms Link
api-domains-driving-license 0 0 0 23 0 1.13s Link
api-domains-education 0 0 0 8 0 148.1ms Link
api-domains-health-insurance 0 0 0 4 0 34.85ms Link

@busla busla added the automerge Merge this PR as soon as all checks pass label Apr 10, 2024
@busla busla merged commit f4ee034 into main Apr 10, 2024
235 of 243 checks passed
@busla busla deleted the chore-remove-postinstall branch April 10, 2024 18:34
Ballioli pushed a commit that referenced this pull request Apr 11, 2024
* chore: remove postinstall script

* fix: added infra-cmds wrapper

* fix: e.message instead of e

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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.

3 participants