Repository navigation
fix: wire Conduit to the Spring Boot 3 backend (#1258) locally - #85
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
1ff11e4 to
5ebe058
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
| import { APIRequestContext } from '@playwright/test'; | ||
|
|
||
| const API_BASE = 'https://api.realworld.show/api'; | ||
| const API_BASE = process.env['API_URL'] ?? 'https://api.realworld.show/api'; |
There was a problem hiding this comment.
🔍 Automatic E2E startup uses public backend
Without an existing frontend server, setting API_URL changes helpers and mocks but leaves browser requests targeting the public API. The webServer configuration launches npm run start, which selects the default environment. Local E2E execution therefore requires a separately running start:local server.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
|
||
| create(article: Partial<Article>): Observable<Article> { | ||
| return this.http.post<{ article: Article }>('/articles/', { article: article }).pipe(map(data => data.article)); | ||
| return this.http.post<{ article: Article }>('/articles', { article: article }).pipe(map(data => data.article)); |
There was a problem hiding this comment.
🔍 Remaining mocks miss revised endpoints
After this change, the creation network-error mock still matches /articles/, so create() bypasses its simulated failure. With the local backend, article deletion and comment deletion mocks also miss requests because they require /api. Those deletion tests can pass without exercising mocked 200 responses.
Was this helpful? React with 👍 or 👎 to provide feedback.
| const PASSWORD = 'password123'; | ||
| const USERS = ['jake', 'ana', 'sam']; |
There was a problem hiding this comment.
👁️ TD Information Security: Published credentials for seeded accounts
Running seed:local gives jake, ana, and sam a repository-published PASSWORD, allowing anyone reaching that backend to impersonate them. The seeding summary also logs it. This violates Secrets and configuration; the demo exemption covers only gitignored local environment files.
View in Devin Review · Custom reviewer
Was this helpful? React with 👍 or 👎 to provide feedback.
|
CHECKED: I ran this PR (5ebe058) in the browser against spring-boot-realworld-example-app#1258 (c9412e43) on fresh seed data. Works: sign up (and duplicate errors), log in (and the wrong-password error), creating and editing articles, the article page, adding and deleting comments, favorites, follow/unfollow, profile tabs, settings with an empty password, logging out and back in, global feed and tag paging. Requests go to Problems:
|
|
Profile-switch fix checked in the browser on c427cf7, against local #1258 on seed data:
CI |
|
CHECKED: the profile switch at c427cf7, in the browser against spring-boot-realworld-example-app #1258 + #1259 (94dab597) on seed data. Going from sam's profile to your own through the navbar now switches the heading, bio, avatar, Edit Profile Settings, posts and favorites. Author links from favorites, back/forward, switching while on the favorites tab and per-user follow state also work.
Minor, not blocking: each navbar switch now loads the profile 3 times (a direct load makes 2, same as before). A nonexistent username shows a blank page with no error, same as before the fix. Your Feed paging with #1259 also passes: 10 + 8 articles, all 18 once each (recording). |
…ST path, non-errors error bodies, seed script, zone.js dev dep)
c427cf7 to
0de77c5
Compare




Summary
Runs the app against the Spring Boot 3.5 / Java 21 backend from spring-boot-realworld-example-app#1258 on
localhost:8080and fixes the contract mismatches found. Stacked on #87's branch (the #79 → #86 → #87 stack), per Git Gossip's merge-order check; merges cleanly with #88.Contract mismatches fixed (all on the Angular side):
ArticlesService.create()posted to/articles/; the backend only mapsPOST /articles(trailing slash → 404 Problem Details). Now/articles.errors: invalid login returns422 { "message": "invalid email or password" }and 404s return Spring Problem Details;errorInterceptorturned both into the fake "Unable to connect" network error. NewnormalizeErrorBody()keepserrorsbodies as-is, otherwise surfacesmessage ?? detail ?? title ?? erroras{ errors: { '': [msg] } }; network fallback only when there is no usable body.ListErrorsComponenttrims the empty key;Errorsvalues typedstring | string[](the backend sends arrays).Checked and already compatible:
Authorization: Token <jwt>(backend splits on the space), CORS preflight fromlocalhost:4200(*origin,Authorization/Content-Typeallowed), request/response envelopes and field names for users, profiles/follow, articles/feed (tag/author/favorited/limit/offset,articlesCount), favorites, comments, tags.Profile switch (bug already on
main, found in the browser run): going from another user's profile to your own via the navbar changed the URL but kept the other user's content. Angular reusesProfileComponentand its tab components across/profile/:username, and they readroute.snapshotonce. They now follow the param (the favorites tab followsroute.parent.paramMap):This was briefly #89, now closed in favor of this PR.
Local wiring:
apiInterceptorreadsenvironment.apiUrlfromsrc/environments/environment.ts(default unchanged:https://api.realworld.show/api).localbuild/serve configuration swaps inenvironment.local.ts(http://localhost:8080);bun run start:local.bun run seed:local(scripts/seed-local.ts): users jake/ana/sam (password123), follows, 27 tagged articles (enough for pagination), comments, favorites.API_BASEreadsprocess.env.API_URL(default unchanged), soAPI_URL=http://localhost:8080 bun run test:e2ehits the same backend.Backend side: Your Feed paging on #1258 returns 5 articles per page and can't reach 8 of 18. spring-boot-realworld-example-app#1259 fixes it (REST and GraphQL); nothing needed here.
Overlaps
bun.lockand feature: ESLint, Vitest CI, gh-release v2, network-free health test (#55 without its Angular bump) #87'spackage.json(itszone.jsis kept, no second entry; this PR only addsstart:local/seed:local),ErrorsstaysRecord<string, string | string[]>, and e2ehealth.spec.tskeeps feature: ESLint, Vitest CI, gh-release v2, network-free health test (#55 without its Angular bump) #87's mocked tags check with its URL built fromAPI_URL.environment.ts(plusenvironment.development.ts) and adds a CSP withconnect-src https://api.realworld.show. Whichever lands second keeps oneenvironment.ts; if bug: fix JwtService storage API/typing, add CSP, move API base URL to environment config #57 lands, its CSP needshttp://localhost:8080inconnect-srcfor thelocalconfig.Verification on this branch:
bun run format:checkclean,bun run test -- --run180/180,bun run buildandbun run lintgreen. #90 fixes the CI Playwright setup onubuntu-latest(26.04).Devin-Org: engineering
Implemented in session Wire Angular RealWorld app to Boot 3 backend
Review with Devin · Open in Devin Desktop