🐛(nginx) add page reconciliation on nginx#2154
Conversation
|
🚀 Preview will be available at https://2154-docs.ppr-docs.beta.numerique.gouv.fr/ You can use the existing account with these credentials:
You can also create a new account if you want to. Once this Pull Request is merged, the preview will be destroyed. |
a3a6201 to
76b8fff
Compare
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis pull request adds a new nginx-frontend service to the Docker Compose setup to serve the impress frontend application. Changes include: adding an nginx-frontend service to Estimated code review effort🎯 3 (Moderate) | ⏱️ ~18 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Makefile`:
- Around line 217-219: The nginx-frontend Make target currently starts the
service without verifying the exported frontend artifacts; update the
nginx-frontend target to perform a preflight check that verifies the mount
directory (src/frontend/apps/impress/out) exists and is non-empty and fail fast
(exit non-zero with a clear error message) before invoking $(COMPOSE) up
--force-recreate -d nginx-frontend, and also fix the target help/comment to
indicate it will build/start only when the export files are present.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 997b65cb-46e1-40f7-8b93-23d1072f1a19
📒 Files selected for processing (4)
CHANGELOG.mdMakefilecompose.ymlsrc/frontend/apps/impress/conf/default.conf
| nginx-frontend: ## build the nginx-frontend container | ||
| @$(COMPOSE) up --force-recreate -d nginx-frontend | ||
| .PHONY: nginx-frontend |
There was a problem hiding this comment.
nginx-frontend can start without build artifacts, causing misleading 404s.
Line 218 starts the service directly, but it depends on src/frontend/apps/impress/out being present (mounted in compose.yml, Line 138). Add a preflight check (and fix the help text) so this target fails fast when export files are missing.
💡 Proposed fix
-nginx-frontend: ## build the nginx-frontend container
+nginx-frontend: ## start nginx-frontend with exported static frontend
+ `@test` -f $(PATH_FRONT_IMPRESS)/out/index.html || ( \
+ echo "Missing $(PATH_FRONT_IMPRESS)/out/index.html. Run 'cd $(PATH_FRONT_IMPRESS) && yarn build' first."; \
+ exit 1 \
+ )
@$(COMPOSE) up --force-recreate -d nginx-frontend
.PHONY: nginx-frontend📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| nginx-frontend: ## build the nginx-frontend container | |
| @$(COMPOSE) up --force-recreate -d nginx-frontend | |
| .PHONY: nginx-frontend | |
| nginx-frontend: ## start nginx-frontend with exported static frontend | |
| `@test` -f $(PATH_FRONT_IMPRESS)/out/index.html || ( \ | |
| echo "Missing $(PATH_FRONT_IMPRESS)/out/index.html. Run 'cd $(PATH_FRONT_IMPRESS) && yarn build' first."; \ | |
| exit 1 \ | |
| ) | |
| @$(COMPOSE) up --force-recreate -d nginx-frontend | |
| .PHONY: nginx-frontend |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@Makefile` around lines 217 - 219, The nginx-frontend Make target currently
starts the service without verifying the exported frontend artifacts; update the
nginx-frontend target to perform a preflight check that verifies the mount
directory (src/frontend/apps/impress/out) exists and is non-empty and fail fast
(exit non-zero with a clear error message) before invoking $(COMPOSE) up
--force-recreate -d nginx-frontend, and also fix the target help/comment to
indicate it will build/start only when the export files are present.
|
Size Change: 0 B Total Size: 4.25 MB 📦 View Changed
|
The nginx conf was lacking the page reconciliation. It is necessary to have it in place to avoid 404 errors when refreshing the page or accessing a page directly. It is a known issue when using the Next Router in "export" mode, as it relies on client-side routing.
To test easily a build application with nginx, we add a nginx-frontend to serve the static files of the application, it will help us to test the application in a more production-like environment.
76b8fff to
cd882c8
Compare
Added - 🔧(backend) settings CONVERSION_UPLOAD_ENABLED to control usage of docspec - 🥚(frontend) add easter egg on doc emoji creation #2155 Changed - ♿(frontend) use aria-haspopup menu on DropButton triggers #2126 - ♿️(frontend) add contextual browser tab titles for docs routes #2120 - ♿️(frontend) fix empty heading before section titles in HTML export #2125 Fixed - ⚡️(frontend) add jitter to WS reconnection #2162 - 🐛(frontend) fix tree pagination #2145 - 🐛(nginx) add page reconciliation on nginx #2154
Added - 🔧(backend) settings CONVERSION_UPLOAD_ENABLED to control usage of docspec - 🥚(frontend) add easter egg on doc emoji creation #2155 Changed - ♿(frontend) use aria-haspopup menu on DropButton triggers #2126 - ♿️(frontend) add contextual browser tab titles for docs routes #2120 - ♿️(frontend) fix empty heading before section titles in HTML export #2125 Fixed - ⚡️(frontend) add jitter to WS reconnection #2162 - 🐛(frontend) fix tree pagination #2145 - 🐛(nginx) add page reconciliation on nginx #2154
Added - 🔧(backend) settings CONVERSION_UPLOAD_ENABLED to control usage of docspec - 🥚(frontend) add easter egg on doc emoji creation #2155 Changed - ♿(frontend) use aria-haspopup menu on DropButton triggers #2126 - ♿️(frontend) add contextual browser tab titles for docs routes #2120 - ♿️(frontend) fix empty heading before section titles in HTML export #2125 Fixed - ⚡️(frontend) add jitter to WS reconnection #2162 - 🐛(frontend) fix tree pagination #2145 - 🐛(nginx) add page reconciliation on nginx #2154
Purpose
The nginx conf was lacking the page reconciliation.
It is necessary to have it in place to avoid 404 errors when refreshing the page or accessing a page directly.
It is a known issue when using the Next Router in "export" mode, as it relies on client-side routing.