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

docs(service-bff): Bff trouble shooting guide #17178

Merged
merged 4 commits into from
Dec 11, 2024
Merged

Conversation

snaerth
Copy link
Member

@snaerth snaerth commented Dec 9, 2024

Bff trouble shooting guide

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

    • Added a "Troubleshooting" section to the BFF service documentation.
    • Introduced a comprehensive troubleshooting guide to assist users with common issues.
  • Documentation

    • Updated README to reference the new troubleshooting guide.

@snaerth snaerth requested a review from a team as a code owner December 9, 2024 11:06
Copy link
Contributor

coderabbitai bot commented Dec 9, 2024

Walkthrough

The pull request introduces updates to the BFF (Backend for Frontend) service documentation. A new "Troubleshooting" section has been added to the README.md file, guiding users to a newly created TROUBLESHOOT_GUIDE.md. This guide outlines common issues, their solutions, and best practices for running the BFF service, including setup instructions and compatibility recommendations for different operating systems.

Changes

File Change Summary
apps/services/bff/README.md Added a new section titled "Troubleshooting" directing users to the TROUBLESHOOT_GUIDE.md.
apps/services/bff/TROUBLESHOOT_GUIDE.md Introduced a comprehensive troubleshooting guide covering common issues and their solutions.

Possibly related PRs

Suggested reviewers

  • eirikurn

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.

coderabbitai[bot]
coderabbitai bot previously requested changes Dec 9, 2024
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

🧹 Outside diff range and nitpick comments (4)
apps/services/bff/TROUBLESHOOT_GUIDE.md (4)

1-4: Consider adding a table of contents for better navigation.

For improved document navigation, especially as the guide grows, consider adding a table of contents after the title. This will help users quickly find relevant sections.

 # BFF Service Troubleshooting Guide

+## Table of Contents
+- [Common Issues and Solutions](#common-issues-and-solutions)
+  - [Development Scripts](#development-scripts)
+  - [Setup and Dependencies](#setup-and-dependencies)
+  - [Redis Server](#redis-server)
+  - [Service Execution](#service-execution)
+  - [Platform-Specific Guidelines](#platform-specific-guidelines)

 ## Common Issues and Solutions

5-7: Improve clarity and formatting of the development script section.

The instruction about script usage needs better formatting and grammar corrections.

-Make sure that you are running the `dev` script and not `start` script. For example when running the service portal you should run:
-  `yarn dev service-portal` and not `yarn start service-portal`.
+Make sure that you are running the `dev` script and not the `start` script. For example, when running the service portal, you should run:
+
+```bash
+yarn dev service-portal
+```
+
+Instead of:
+
+```bash
+yarn start service-portal
+```
🧰 Tools
🪛 LanguageTool

[typographical] ~5-~5: After the expression ‘for example’ a comma is usually used.
Context: ...devscript and notstart` script. For example when running the service portal you sho...

(COMMA_FOR_EXAMPLE)


15-19: Enhance Redis server section with clearer context.

The Redis section needs better explanation of its purpose and proper grammar.

-Not necessary but a nice to have is to have Redis server running:
+Running a Redis server is optional but recommended:
+
+  - Redis is used for session management in the BFF service.
+  - To start a Redis server, run:
+    ```bash
+    yarn dev-services services-bff
+    ```
+  - Without Redis, sessions will not persist between service restarts.
-  - Run `yarn dev-services services-bff` to start Redis server.
-  - This is necessary if you want the sessions to persist.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~15-~15: Possible missing comma found.
Context: ...he correct AWS account. - Not necessary but a nice to have is to have Redis server ...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~15-~15: You might be missing the article “a” here.
Context: ...necessary but a nice to have is to have Redis server running: - Run `yarn dev-serv...

(AI_EN_LECTOR_MISSING_DETERMINER_A)


[uncategorized] ~17-~17: You might be missing the article “the” here.
Context: ...arn dev-services services-bff` to start Redis server. - This is necessary if you wa...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


32-37: Organize platform-specific instructions into clear sections.

The platform-specific guidance needs better organization and formatting.

+## Platform-Specific Guidelines
+
+### Windows Users
 - If you are running the service on Windows, we recommend using [WSL2](https://docs.microsoft.com/en-us/windows/wsl/install) for running the services within the repo.
-  This is because all of the scripts generated by the `infra` package are not tested on Windows and may not work as expected.
+  The scripts generated by the `infra` package are not tested on Windows and may not work as expected.
+
+### macOS Users
 - On macOS, the AirPlay Receiver is listening on the same port as the Redis server, e.g. 7000. Either change the port or disable the AirPlay Receiver.
+  - To change Redis port: Edit the `dev-services` configuration
+  - To disable AirPlay: System Preferences → Sharing → Uncheck "AirPlay Receiver"
+
+## Last Resort
+If you've tried all the above solutions without success:
 - If everything fails, then a good old computer restart might do the trick.
🧰 Tools
🪛 LanguageTool

[style] ~33-~33: Consider removing “of” to be more concise
Context: ...ices within the repo. This is because all of the scripts generated by the infra packag...

(ALL_OF_THE)


[style] ~33-~33: To make your text as clear as possible to all readers, do not use this foreign term. Possible alternatives are “below” or “further on” (in a document).
Context: ...use all of the scripts generated by the infra package are not tested on Windows and ...

(INFRA)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 31b2fdb and 854cb3e.

📒 Files selected for processing (2)
  • apps/services/bff/README.md (1 hunks)
  • apps/services/bff/TROUBLESHOOT_GUIDE.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • apps/services/bff/README.md
🧰 Additional context used
📓 Path-based instructions (1)
apps/services/bff/TROUBLESHOOT_GUIDE.md (2)

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

  • NestJS architecture, including modules, services, and controllers.
  • Dependency injection patterns and service encapsulation.
  • Integration and unit testing coverage and practices."

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."
🪛 LanguageTool
apps/services/bff/TROUBLESHOOT_GUIDE.md

[typographical] ~5-~5: After the expression ‘for example’ a comma is usually used.
Context: ...devscript and notstart` script. For example when running the service portal you sho...

(COMMA_FOR_EXAMPLE)


[grammar] ~11-~11: The word “login” is a noun. The verb is spelled with a white space.
Context: ...stall && yarn codegen`. - Make sure to login to the correct AWS account and region: ...

(NOUN_VERB_CONFUSION)


[grammar] ~13-~13: The word “login” is a noun. The verb is spelled with a white space.
Context: ...ws sso login --profile islandis-dev` to login to the correct AWS account. - Not nece...

(NOUN_VERB_CONFUSION)


[uncategorized] ~15-~15: Possible missing comma found.
Context: ...he correct AWS account. - Not necessary but a nice to have is to have Redis server ...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~15-~15: You might be missing the article “a” here.
Context: ...necessary but a nice to have is to have Redis server running: - Run `yarn dev-serv...

(AI_EN_LECTOR_MISSING_DETERMINER_A)


[uncategorized] ~17-~17: You might be missing the article “the” here.
Context: ...arn dev-services services-bff` to start Redis server. - This is necessary if you wa...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[uncategorized] ~21-~21: It seems likely that a singular genitive (’s) apostrophe is missing.
Context: ...lready be running a service like API. Lets take yarn dev application-system-form...

(AI_HYDRA_LEO_APOSTROPHE_S_XS)


[style] ~33-~33: Consider removing “of” to be more concise
Context: ...ices within the repo. This is because all of the scripts generated by the infra packag...

(ALL_OF_THE)


[style] ~33-~33: To make your text as clear as possible to all readers, do not use this foreign term. Possible alternatives are “below” or “further on” (in a document).
Context: ...use all of the scripts generated by the infra package are not tested on Windows and ...

(INFRA)

apps/services/bff/TROUBLESHOOT_GUIDE.md Show resolved Hide resolved
apps/services/bff/TROUBLESHOOT_GUIDE.md Show resolved Hide resolved
Copy link

codecov bot commented Dec 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 35.76%. Comparing base (0423040) to head (4a109a8).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #17178   +/-   ##
=======================================
  Coverage   35.76%   35.76%           
=======================================
  Files        6931     6931           
  Lines      147959   147959           
  Branches    42168    42168           
=======================================
+ Hits        52923    52924    +1     
+ Misses      95036    95035    -1     
Flag Coverage Δ
air-discount-scheme-backend 48.20% <ø> (ø)
air-discount-scheme-web 0.00% <ø> (ø)
api 3.33% <ø> (ø)
api-catalogue-services 75.81% <ø> (ø)
api-domains-air-discount-scheme 37.90% <ø> (ø)
api-domains-assets 26.71% <ø> (ø)
api-domains-auth-admin 48.49% <ø> (ø)
api-domains-communications 39.42% <ø> (ø)
api-domains-criminal-record 47.92% <ø> (ø)
api-domains-driving-license 44.81% <ø> (ø)
api-domains-education 31.22% <ø> (ø)
api-domains-health-insurance 35.33% <ø> (ø)
api-domains-mortgage-certificate 35.16% <ø> (ø)
api-domains-payment-schedule 42.04% <ø> (ø)
application-api-files 61.73% <ø> (ø)
application-core 76.01% <ø> (ø)
application-system-api 38.76% <ø> (-0.01%) ⬇️
application-template-api-modules 27.81% <ø> (+0.01%) ⬆️
application-templates-accident-notification 28.93% <ø> (ø)
application-templates-car-recycling 3.12% <ø> (ø)
application-templates-criminal-record 25.78% <ø> (ø)
application-templates-driving-license 18.12% <ø> (ø)
application-templates-estate 13.79% <ø> (ø)
application-templates-example-payment 24.71% <ø> (ø)
application-templates-financial-aid 14.42% <ø> (ø)
application-templates-general-petition 23.13% <ø> (ø)
application-templates-inheritance-report 6.54% <ø> (ø)
application-templates-marriage-conditions 15.11% <ø> (ø)
application-templates-mortgage-certificate 43.56% <ø> (ø)
application-templates-parental-leave 29.95% <ø> (ø)
application-types 6.57% <ø> (ø)
application-ui-components 1.24% <ø> (ø)
application-ui-shell 22.43% <ø> (ø)
auth-admin-web 2.43% <ø> (ø)
auth-nest-tools 31.52% <ø> (ø)
auth-shared 75.00% <ø> (ø)
clients-charge-fjs-v2 28.35% <ø> (ø)
clients-driving-license 40.79% <ø> (ø)
clients-driving-license-book 43.83% <ø> (ø)
clients-financial-statements-inao 49.59% <ø> (ø)
clients-license-client 1.26% <ø> (ø)
clients-middlewares 72.89% <ø> (-0.25%) ⬇️
clients-regulations 42.87% <ø> (ø)
clients-rsk-company-registry 31.04% <ø> (ø)
clients-rsk-personal-tax-return 38.32% <ø> (ø)
clients-smartsolutions 12.77% <ø> (ø)
clients-syslumenn 49.41% <ø> (ø)
clients-zendesk 50.46% <ø> (ø)
cms 0.40% <ø> (ø)
cms-translations 38.75% <ø> (ø)
content-search-index-manager 95.65% <ø> (ø)
content-search-toolkit 8.20% <ø> (ø)
contentful-apps 4.72% <ø> (ø)
dokobit-signing 62.10% <ø> (ø)
email-service 60.07% <ø> (ø)
feature-flags 90.76% <ø> (ø)
file-storage 45.86% <ø> (ø)
financial-aid-backend 51.40% <ø> (ø)
financial-aid-shared 17.88% <ø> (ø)
icelandic-names-registry-backend 54.33% <ø> (ø)
infra-nest-server 48.06% <ø> (ø)
infra-tracing 69.63% <ø> (ø)
island-ui-core 30.92% <ø> (ø)
judicial-system-api 20.16% <ø> (ø)
judicial-system-audit-trail 68.94% <ø> (ø)
judicial-system-backend 55.88% <ø> (ø)
judicial-system-formatters 78.28% <ø> (ø)
judicial-system-message 66.47% <ø> (ø)
judicial-system-message-handler 48.23% <ø> (ø)
judicial-system-scheduler 70.97% <ø> (ø)
judicial-system-types 42.22% <ø> (ø)
judicial-system-web 27.89% <ø> (ø)
license-api 42.91% <ø> (ø)
localization 10.15% <ø> (ø)
logging 58.02% <ø> (ø)
message-queue 67.76% <ø> (ø)
nest-audit 65.78% <ø> (ø)
nest-aws 51.93% <ø> (ø)
nest-config 76.38% <ø> (ø)
nest-core 53.16% <ø> (ø)
nest-feature-flags 51.00% <ø> (ø)
nest-problem 45.64% <ø> (ø)
nest-sequelize 94.44% <ø> (ø)
nest-swagger 51.13% <ø> (ø)
nova-sms 61.42% <ø> (ø)
portals-admin-regulations-admin 1.80% <ø> (ø)
portals-core 19.76% <ø> (ø)
regulations 16.78% <ø> (ø)
residence-history 85.00% <ø> (ø)
services-auth-admin-api 52.55% <ø> (ø)
services-auth-delegation-api 58.44% <ø> (-0.09%) ⬇️
services-auth-ids-api 52.54% <ø> (ø)
services-auth-public-api 49.40% <ø> (+<0.01%) ⬆️
services-sessions 65.35% <ø> (ø)
services-university-gateway 49.51% <ø> (ø)
services-user-notification 46.58% <ø> (ø)
services-user-profile 56.98% <ø> (ø)
shared-components 30.08% <ø> (ø)
shared-form-fields 33.88% <ø> (ø)
shared-mocking 58.64% <ø> (ø)
shared-pii 92.85% <ø> (ø)
shared-problem 87.50% <ø> (ø)
shared-utils 27.69% <ø> (ø)
skilavottord-ws 24.31% <ø> (ø)
web 2.43% <ø> (ø)

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

see 1 file 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 0423040...4a109a8. Read the comment docs.

@snaerth snaerth added the automerge Merge this PR as soon as all checks pass label Dec 9, 2024
@datadog-island-is
Copy link

datadog-island-is bot commented Dec 9, 2024

Datadog Report

All test runs a840e71 🔗

98 Total Test Services: 0 Failed, 90 Passed
🔻 Test Sessions change in coverage: 2 decreased, 2 increased, 195 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.96s N/A Link
air-discount-scheme-web 0 0 0 2 0 6.73s N/A Link
api 0 0 0 4 0 2.41s N/A Link
api-catalogue-services 0 0 0 23 0 8.98s N/A Link
api-domains-air-discount-scheme 0 0 0 6 0 17s N/A Link
api-domains-assets 0 0 0 3 0 9.68s N/A Link
api-domains-auth-admin 0 0 0 18 0 10.33s N/A Link
api-domains-communications 0 0 0 5 0 38.95s N/A Link
api-domains-criminal-record 0 0 0 5 0 11.11s N/A Link
services-auth-delegation-api 0 0 0 270 0 2m 58.6s 1 decreased (-0.04%) Link

🔻 Code Coverage Decreases vs Default Branch (2)

  • clients-middlewares - jest 75.6% (-0.1%) - Details
  • services-auth-delegation-api - jest 50.43% (-0.04%) - Details

@kodiakhq kodiakhq bot merged commit 7dce5d8 into main Dec 11, 2024
266 checks passed
@kodiakhq kodiakhq bot deleted the bff_troubleshoot_guide branch December 11, 2024 11:31
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.

2 participants