Skip to content

Conversation

@carlosthe19916
Copy link
Collaborator

@carlosthe19916 carlosthe19916 commented Nov 8, 2025

This PR allows the existence of 2 different devcontainers:

  • node: used for normal development of the UI as it has NodeJS 22 installed and also includes VSCode extensions ready for them to be used in daily UI development
  • playwright: used for executing the e2e tests. We need a separate devcontainer because it needs to run in the host network due to the fact that the oidc urls need to be "localhost" related

More or less depends on guacsec/trustify#2096 as we need also a backend dev environment for the UI dev environment to work.

Summary by Sourcery

Introduce dedicated devcontainers for Node-based UI development and Playwright-based end-to-end testing, update documentation and clean up legacy scripts.

New Features:

  • Add Node devcontainer for UI development with Node 22 and preconfigured VSCode extensions
  • Add Playwright devcontainer for end-to-end testing running on host network

Documentation:

  • Simplify and update VSCode setup instructions in .devcontainer README

Chores:

  • Remove outdated devcontainer generator script, template, and single Dockerfile

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Nov 8, 2025

Reviewer's Guide

This PR introduces two dedicated DevContainer workflows—one for Node.js-based UI development and another for Playwright-based end-to-end testing—updates the development README with streamlined instructions, and removes outdated template scripts.

Flow diagram for devcontainer selection and environment setup

flowchart TD
  A["User opens repository in VSCode"] --> B{"Select DevContainer"}
  B -->|"Node"| C["Start Node DevContainer"]
  B -->|"Playwright"| D["Start Playwright DevContainer"]
  C --> E["NodeJS 22 environment for UI development"]
  D --> F["Playwright environment for E2E tests (host network)"]
Loading

File-Level Changes

Change Details Files
Refine devcontainer usage documentation
  • Removed generate_devcontainer.sh instructions and deprecated template references
  • Added VSCode extension install and container reopen commands
  • Clarified optional podman settings
.devcontainer/README.md
Introduce Node.js devcontainer setup
  • Add Dockerfile based on devcontainers/base:ubuntu
  • Define docker-compose service with custom network, environment variables, and volume mapping
  • Include stub devcontainer.json for Node environment
.devcontainer/node/docker-compose.yml
.devcontainer/node/Dockerfile
.devcontainer/node/devcontainer.json
Introduce Playwright devcontainer for e2e tests
  • Use mcr.microsoft.com/playwright base image
  • Configure docker-compose service with host network mode and workspace volume
  • Include stub devcontainer.json for Playwright environment
.devcontainer/playwright/docker-compose.yml
.devcontainer/playwright/Dockerfile
.devcontainer/playwright/devcontainer.json
Remove outdated devcontainer templates and scripts
  • Delete generate_devcontainer.sh, template.json, and top-level Dockerfile
  • Remove obsolete .devcontainer/Dockerfile template
.devcontainer/generate_devcontainer.sh
.devcontainer/template.json
.devcontainer/Dockerfile

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • The node Dockerfile only inherits from Ubuntu and doesn’t install Node.js or required dev tools—either add the Node.js installation steps or base it on an official Node image.
  • Both docker-compose.yml files are missing a version/schema declaration, which could cause compatibility issues—add a version: '3.x' or Compose field at the top.
  • You’re duplicating a lot of configuration across two devcontainer folders; consider using devcontainer.json profiles in a single setup to centralize shared settings.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The node Dockerfile only inherits from Ubuntu and doesn’t install Node.js or required dev tools—either add the Node.js installation steps or base it on an official Node image.
- Both docker-compose.yml files are missing a version/schema declaration, which could cause compatibility issues—add a `version: '3.x'` or Compose field at the top.
- You’re duplicating a lot of configuration across two devcontainer folders; consider using devcontainer.json profiles in a single setup to centralize shared settings.

## Individual Comments

### Comment 1
<location> `.devcontainer/node/docker-compose.yml:16` </location>
<code_context>
+    environment:
+      TRUSTIFY_API_URL: http://trustify:8080
+      OIDC_SERVER_URL: http://localhost:9090/realms/trustify
+    command: tail -f /dev/null
+    volumes:
+      - ../..:/workspace:cached
</code_context>

<issue_to_address>
**suggestion:** Consider replacing 'tail -f /dev/null' with a more meaningful default command.

This approach may hide startup issues. Prefer setting the default command to launch the UI service, or clearly document why 'tail -f /dev/null' is used.

Suggested implementation:

```
    # The default command is set to start the UI service.
    # Replace 'npm start' with the actual start command if different.
    command: npm start

```

If the actual UI start command is not `npm start`, replace it with the correct command (e.g., `yarn start`, `pnpm dev`, or the entrypoint script for your UI).
If you must keep `tail -f /dev/null` for development reasons, add a comment above it explaining why, e.g.:
```
# 'tail -f /dev/null' is used to keep the container running for debugging purposes.
# Replace with the actual UI start command for production or normal development.
command: tail -f /dev/null
```
</issue_to_address>

### Comment 2
<location> `.devcontainer/playwright/docker-compose.yml:9` </location>
<code_context>
+    security_opt:
+      - "label=disable"
+    userns_mode: "keep-id"
+    network_mode: host
+    volumes:
+      - ../..:/workspace:cached
</code_context>

<issue_to_address>
**🚨 suggestion (security):** Using 'network_mode: host' may have security and portability implications.

If host networking is necessary for Playwright tests, please document the rationale and any associated security risks.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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.

1 participant