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(api): GraphQL api with BFF on startup support for DX #15980

Closed
wants to merge 10 commits into from

Conversation

snaerseljan
Copy link
Contributor

@snaerseljan snaerseljan commented Sep 12, 2024

DX for GraphQL api and bff.

What

Since the arrival of the BFF that both our portals will communicate with, we need to make sure that the DX is great for developers. This pull request aims to solve that problem in neat manner.

When developers run the nx run portals-admin:dev command, the BFF server is started automatically alongside it. All necessary environment variables are preconfigured to streamline the development setup.

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

@snaerseljan snaerseljan requested review from a team as code owners September 12, 2024 15:41
Copy link
Contributor

coderabbitai bot commented Sep 12, 2024

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Base branches to auto review (1)
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.

process.env.BFF_TOKEN_SECRET_BASE64 =
// This is a valid 32-byte base64 encoded secret.
// You can generate a new one by running `openssl rand -base64 32`
'Y0ROrC3mxDBnveN+EpAnLtSubttyjZZWcV43dyk7OQI='
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note that this secret is not used anywhere but locally

Copy link

codecov bot commented Sep 12, 2024

Codecov Report

Attention: Patch coverage is 47.22222% with 19 lines in your changes missing coverage. Please review.

Project coverage is 36.74%. Comparing base (f1f4d01) to head (28c5404).
Report is 393 commits behind head on feat/bff.

Files with missing lines Patch % Lines
libs/shared/utils/src/lib/server/startProcess.ts 9.52% 19 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##           feat/bff   #15980      +/-   ##
============================================
+ Coverage     36.44%   36.74%   +0.30%     
============================================
  Files          6755     6729      -26     
  Lines        139862   138694    -1168     
  Branches      39910    39578     -332     
============================================
+ Hits          50968    50970       +2     
+ Misses        88894    87724    -1170     
Flag Coverage Δ
air-discount-scheme-backend 54.20% <100.00%> (+0.13%) ⬆️
air-discount-scheme-web 0.00% <ø> (ø)
api 3.34% <ø> (ø)
api-catalogue-services 77.85% <ø> (ø)
api-domains-air-discount-scheme 37.25% <100.00%> (+0.40%) ⬆️
api-domains-assets 26.71% <ø> (ø)
api-domains-auth-admin 49.89% <ø> (ø)
api-domains-communications 40.43% <ø> (+0.44%) ⬆️
api-domains-criminal-record 47.81% <ø> (+0.03%) ⬆️
api-domains-driving-license 44.47% <100.00%> (+0.15%) ⬆️
api-domains-education 31.25% <ø> (-0.08%) ⬇️
api-domains-mortgage-certificate 35.75% <ø> (+0.02%) ⬆️
api-domains-payment-schedule 41.52% <100.00%> (+0.37%) ⬆️
application-api-files 57.48% <ø> (-0.11%) ⬇️
application-core 72.25% <ø> (+0.95%) ⬆️
application-system-api 41.66% <47.22%> (+0.16%) ⬆️
application-template-api-modules 23.49% <47.22%> (+0.03%) ⬆️
application-templates-accident-notification 22.26% <ø> (+0.12%) ⬆️
application-templates-car-recycling 3.12% <ø> (ø)
application-templates-criminal-record 26.96% <ø> (+0.32%) ⬆️
application-templates-driving-license 18.75% <ø> (+0.11%) ⬆️
application-templates-estate 12.52% <ø> (+0.20%) ⬆️
application-templates-example-payment 25.72% <ø> (+0.31%) ⬆️
application-templates-financial-aid 14.47% <100.00%> (+0.13%) ⬆️
application-templates-general-petition 23.95% <ø> (+0.27%) ⬆️
application-templates-health-insurance 26.88% <ø> (+0.25%) ⬆️
application-templates-inheritance-report 6.48% <ø> (+0.02%) ⬆️
application-templates-marriage-conditions 15.35% <ø> (+0.11%) ⬆️
application-templates-mortgage-certificate 44.18% <ø> (+0.18%) ⬆️
application-templates-parental-leave 29.31% <ø> (-0.85%) ⬇️
application-types 6.74% <ø> (+0.03%) ⬆️
application-ui-components 1.52% <ø> (+0.24%) ⬆️
application-ui-shell 21.57% <ø> (+0.44%) ⬆️
auth-admin-web 2.43% <ø> (ø)
auth-nest-tools 31.02% <ø> (-0.20%) ⬇️
auth-react 22.82% <ø> (+0.01%) ⬆️
auth-shared 75.00% <ø> (ø)
clients-charge-fjs-v2 24.11% <ø> (ø)
clients-driving-license 40.61% <ø> (+0.04%) ⬆️
clients-driving-license-book 43.88% <ø> (+0.02%) ⬆️
clients-financial-statements-inao 49.13% <ø> (+0.03%) ⬆️
clients-license-client 1.83% <ø> (ø)
clients-middlewares 73.11% <ø> (+0.16%) ⬆️
clients-regulations 42.58% <ø> (+0.04%) ⬆️
clients-rsk-company-registry 29.76% <ø> (ø)
clients-rsk-personal-tax-return 38.00% <ø> (ø)
clients-smartsolutions 12.77% <ø> (ø)
clients-syslumenn 49.77% <ø> (+0.02%) ⬆️
clients-zendesk 55.65% <ø> (ø)
cms 0.42% <ø> (-0.01%) ⬇️
cms-translations 39.59% <ø> (+0.46%) ⬆️
content-search-index-manager 95.65% <ø> (ø)
content-search-toolkit 8.50% <ø> (ø)
contentful-apps 6.05% <ø> (+0.28%) ⬆️
dokobit-signing 62.94% <ø> (ø)
download-service 44.72% <100.00%> (+0.14%) ⬆️
email-service 60.73% <ø> (ø)
feature-flags 90.76% <ø> (ø)
file-storage 53.13% <ø> (ø)
financial-aid-backend 56.69% <100.00%> (+0.17%) ⬆️
financial-aid-shared 19.03% <ø> (ø)
icelandic-names-registry-backend 54.99% <100.00%> (+0.43%) ⬆️
infra-nest-server 48.95% <ø> (ø)
infra-tracing 43.24% <ø> (ø)
island-ui-core 28.59% <ø> (+0.01%) ⬆️
judicial-system-api 19.35% <ø> (+0.74%) ⬆️
judicial-system-audit-trail 68.61% <ø> (ø)
judicial-system-backend 55.64% <20.83%> (+0.92%) ⬆️
judicial-system-formatters 79.83% <ø> (ø)
judicial-system-message 66.86% <ø> (ø)
judicial-system-message-handler 47.71% <ø> (ø)
judicial-system-scheduler 69.01% <ø> (ø)
judicial-system-types 48.34% <ø> (ø)
judicial-system-web 28.71% <ø> (+0.14%) ⬆️
license-api 42.96% <100.00%> (+0.47%) ⬆️
localization 10.15% <ø> (ø)
logging 48.43% <ø> (ø)
message-queue 68.50% <ø> (ø)
nest-audit 68.20% <ø> (ø)
nest-config 78.13% <ø> (ø)
nest-feature-flags 51.97% <ø> (+0.72%) ⬆️
nest-problem 46.39% <ø> (ø)
nest-sequelize 94.44% <ø> (ø)
nest-swagger 51.71% <ø> (ø)
nova-sms 62.28% <ø> (ø)
portals-admin-regulations-admin 1.96% <ø> (+0.01%) ⬆️
portals-core 16.26% <ø> (-0.03%) ⬇️
reference-backend 50.47% <ø> (ø)
regulations 16.78% <ø> (ø)
residence-history 85.00% <ø> (ø)
services-auth-delegation-api 61.36% <100.00%> (+0.08%) ⬆️
services-auth-personal-representative 48.04% <100.00%> (+0.10%) ⬆️
services-documents 61.48% <100.00%> (+0.29%) ⬆️
services-endorsements-api 55.11% <100.00%> (+0.04%) ⬆️
services-sessions 65.95% <100.00%> (+0.23%) ⬆️
services-university-gateway 48.49% <ø> (+0.01%) ⬆️
services-user-notification 47.67% <100.00%> (+0.51%) ⬆️
services-user-profile 62.34% <100.00%> (+0.08%) ⬆️
shared-components 27.67% <ø> (-0.04%) ⬇️
shared-form-fields 31.58% <ø> (-0.04%) ⬇️
shared-mocking 64.62% <ø> (ø)
shared-pii 92.85% <ø> (ø)
shared-problem 87.50% <ø> (ø)
shared-utils 25.26% <0.00%> (-3.66%) ⬇️
skilavottord-ws 24.34% <ø> (ø)
web 1.84% <ø> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
libs/auth/scopes/src/index.ts 100.00% <100.00%> (ø)
...auth/scopes/src/lib/clients/admin-portal-scopes.ts 100.00% <100.00%> (ø)
...th/scopes/src/lib/clients/service-portal-scopes.ts 100.00% <100.00%> (ø)
libs/react-spa/bff/src/lib/bff.utils.ts 30.00% <ø> (ø)
libs/shared/utils/src/lib/server/env.ts 13.33% <ø> (ø)
...shared/utils/src/lib/server/removeTrailingSlash.ts 0.00% <ø> (ø)
libs/shared/utils/src/server.ts 100.00% <100.00%> (ø)
libs/shared/utils/src/lib/server/startProcess.ts 9.52% <9.52%> (ø)

... and 198 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 f1f4d01...28c5404. Read the comment docs.

@datadog-island-is
Copy link

datadog-island-is bot commented Sep 12, 2024

Datadog Report

All test runs 0c58281 🔗

100 Total Test Services: 0 Failed, 98 Passed
🔻 Test Sessions change in coverage: 15 decreased, 26 increased, 157 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 81 0 30.05s N/A Link
air-discount-scheme-web 0 0 0 2 0 9.07s N/A Link
api 0 0 0 4 0 2.8s N/A Link
api-catalogue-services 0 0 0 23 0 11.8s N/A Link
api-domains-air-discount-scheme 0 0 0 6 0 19.47s N/A Link
api-domains-assets 0 0 0 3 0 12.34s N/A Link
api-domains-auth-admin 0 0 0 18 0 12.98s N/A Link
api-domains-communications 0 0 0 5 0 33.48s N/A Link
api-domains-criminal-record 0 0 0 5 0 10.29s N/A Link
api-domains-driving-license 0 0 0 23 0 33.51s N/A Link

🔻 Code Coverage Decreases vs Default Branch (15)

This report shows up to 5 code coverage decreases.

  • shared-utils - jest 26.19% (-3.81%) - Details
  • shared-components - jest 34.67% (-0.15%) - Details
  • reference-backend - jest 55.21% (-0.13%) - Details
  • nest-problem - jest 50.99% (-0.12%) - Details
  • portals-core - jest 24.62% (-0.11%) - Details

@snaerseljan snaerseljan requested a review from a team as a code owner September 16, 2024 11:00
@busla busla force-pushed the feat/bff branch 2 times, most recently from be338ac to 32e5ae2 Compare October 10, 2024 14:58
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