Skip to content

fix: wire Conduit to the Spring Boot 3 backend (#1258) locally - #85

Open
devin-ai-integration[bot] wants to merge 2 commits into
devin/task-19-eslint-ci-on-overridesfrom
devin/task-25-angular-boot3-contract-v2
Open

devin-ai-integration[bot] wants to merge 2 commits into
devin/task-19-eslint-ci-on-overridesfrom
devin/task-25-angular-boot3-contract-v2

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Summary

Runs the app against the Spring Boot 3.5 / Java 21 backend from spring-boot-realworld-example-app#1258 on localhost:8080 and 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 maps POST /articles (trailing slash → 404 Problem Details). Now /articles.
  • Error bodies without errors: invalid login returns 422 { "message": "invalid email or password" } and 404s return Spring Problem Details; errorInterceptor turned both into the fake "Unable to connect" network error. New normalizeErrorBody() keeps errors bodies as-is, otherwise surfaces message ?? detail ?? title ?? error as { errors: { '': [msg] } }; network fallback only when there is no usable body. ListErrorsComponent trims the empty key; Errors values typed string | string[] (the backend sends arrays).

Checked and already compatible: Authorization: Token <jwt> (backend splits on the space), CORS preflight from localhost:4200 (* origin, Authorization/Content-Type allowed), 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 reuses ProfileComponent and its tab components across /profile/:username, and they read route.snapshot once. They now follow the param (the favorites tab follows route.parent.paramMap):

this.route.paramMap.pipe(switchMap(params => this.profileService.get(params.get('username')!)), ...)

This was briefly #89, now closed in favor of this PR.

Local wiring:

  • apiInterceptor reads environment.apiUrl from src/environments/environment.ts (default unchanged: https://api.realworld.show/api).
  • local build/serve configuration swaps in environment.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.
  • e2e API_BASE reads process.env.API_URL (default unchanged), so API_URL=http://localhost:8080 bun run test:e2e hits 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

Verification on this branch: bun run format:check clean, bun run test -- --run 180/180, bun run build and bun run lint green. #90 fixes the CI Playwright setup on ubuntu-latest (26.04).

Devin-Org: engineering


Migration Engineer opened this PR for Matthew
Implemented in session Wire Angular RealWorld app to Boot 3 backend
Review with Devin · Open in Devin Desktop


@devin-ai-integration

Copy link
Copy Markdown
Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration
devin-ai-integration Bot changed the base branch from devin/1785229819-jwt-csp-env to main November 17, 2026 05:26
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/task-25-angular-boot3-contract-v2 branch from 1ff11e4 to 5ebe058 Compare November 17, 2026 05:26

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Devin Review found 3 potential issues.

Custom reviewers

  • 🧪 Test 2 reviewer: no findings · View
  • 🚩 TD Enterprise Architecture: no findings · View
  • 👁️ TD Information Security: 1 finding · View
  • 🧠 TD French Language (Bill 96): no findings · View
  • ⏱️ TD API Contracts: no findings · View

Devin Review

Comment thread e2e/helpers/api.ts
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';

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

🔍 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.

Devin Review


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));

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

🔍 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.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread scripts/seed-local.ts
Comment on lines +8 to +9
const PASSWORD = 'password123';
const USERS = ['jake', 'ana', 'sam'];

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

👁️ 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

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@devin-ai-integration

Copy link
Copy Markdown
Author

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 localhost:8080 with Authorization: Token, and CORS passes.

Problems:

Recording

Your Feed page 1
Stale profile

Written by Devin

@devin-ai-integration

Copy link
Copy Markdown
Author

Profile-switch fix checked in the browser on c427cf7, against local #1258 on seed data:

  • Going from sam's profile to your own through the navbar updates the avatar, bio, action button and posts without a reload.
  • Going from your own profile to sam through an author link updates correctly.
  • Going from sam's Favorited Posts to your own shows your favorites, not sam's.
  • Reloading /profile/jake/favorites still works.
Before: sam After navbar switch: jake (no reload)
sam jake

Recording

CI test and security-tests fail at playwright install --with-deps chromium because Playwright 1.58 doesn't support ubuntu-latest, which is now Ubuntu 26.04. They fail before any test runs, the same as on #79. Locally, format, 180/180 unit tests and build pass.

Written by Devin

@devin-ai-integration

Copy link
Copy Markdown
Author

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.

Before (5ebe058) After (c427cf7)
stale fixed

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).

Recording

Written by Devin

@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/task-25-angular-boot3-contract-v2 branch from c427cf7 to 0de77c5 Compare November 17, 2026 06:09
@devin-ai-integration
devin-ai-integration Bot changed the base branch from main to devin/task-19-eslint-ci-on-overrides November 17, 2026 06:09
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.

0 participants