Skip to content

[operator] consider extending the visibility of fields in base implementations #426

Description

@kittaakos

Is your feature request related to a problem? Please describe.

Please extend the visibility of the fields in the default implementations. Thank you

From the docs:

We provide a library (`org.eclipse.theia.cloud.operator`), as well as a default implementation (`org.eclipse.theia.cloud.defaultoperator`) for the operator.
The library can be used to create an operator customized to your use cases.
The default implementation is a production-ready operator that handles most use cases on most cloud providers out of the box and is used in our demos.

There is a nice way to customize the Guice module, but all fields are private, making it inconvenient to customize in a downstream project:

@Inject
private TheiaCloudClient resourceClient;
@Inject
protected Set<OperatorPlugin> operatorPlugins;
@Inject
private AppDefinitionHandler appDefinitionAddedHandler;
@Inject
private WorkspaceHandler workspaceHandler;
@Inject
private SessionHandler sessionHandler;
@Inject
private TheiaCloudOperatorArguments arguments;
private final Map<String, AppDefinition> appDefinitionCache = new ConcurrentHashMap<>();
private final Map<String, Workspace> workspaceCache = new ConcurrentHashMap<>();
private final Map<String, Session> sessionCache = new ConcurrentHashMap<>();
private final Set<SpecWatch<?>> watches = new LinkedHashSet<>();

Describe the solution you'd like

Fields are protected, making it easier to customize the default implementation.

Describe alternatives you've considered

Use Java reflection for the framework customization

Cluster provider

No response

Additional information

No response

Activity

  1. jfaltermeier commented on May 14, 2025

    @jfaltermeier
    Contributor

    Thanks for the report, the request makes sense. We try to open things up as we identify the use cases.
    We are also happy to accept contributions if you’d like to open a PR.

  2. self-assigned this
    on May 16, 2025
  3. kittaakos commented on May 19, 2025

    @kittaakos
    Author

    Thanks for taking care of the fixes and implementing the necessary changes.

    We are also happy to accept contributions if you’d like to open a PR.

    I'm happy to push back my changes — I'll check internally about our contribution policy first.

    While customizing the operator and Theia contributions, I ran into a few areas where I think the framework could be improved. Just sharing a few here for visibility (feel free to spin them off into separate issues, or I can do that later when you have closed this issue):

    • Operator test setup: The operator currently lacks tests. It can be confusing for newcomers to navigate the hybrid use of Guice and Jakarta DI across the Java projects. It’s also unclear what the preferred approach is for testing with proper injection.
    • Message extensibility: Customizing messages between operator, backend, and frontend is tricky. Since many APIs and classes are not POJOs or JSON-like, extending behavior (e.g. modifying string-based parameters) often means copying entire implementations.
    • Theia activity tracker API: The common Theia backend/frontend protocol exposes an express Router, which might not be the cleanest abstraction. It could benefit from a more structured API.
    • Monitor request robustness: When the operator sends a monitor request and the response fails (e.g. non-2xx), the failure is silently swallowed. This makes it difficult to trust the operator for critical lifecycle flows.
    • startServer should resolve with a Promise:
      export function startServer(port: number): void {
    • Use express from shared Theia:
      import { json, Router } from 'express';

    Related issues:

  4. kittaakos commented on May 20, 2025

    @kittaakos
    Author

    We are also happy to accept contributions if you’d like to open a PR.

    I'm happy to push back my changes — I'll check internally about our contribution policy first.

    It's OK.

    @jfaltermeier, would you be open to reviewing the proposals and, if they look good, helping to get them into a new release?

  5. jfaltermeier commented on May 20, 2025

    @jfaltermeier
    Contributor

    Sure, happy to review the PRs. Just @ me once they are opened.

  6. github-actions commented on Nov 16, 2025

    @github-actions

    This issue is stale because it has been open for 180 days with no activity.

  7. github-actions commented on May 17, 2026

    @github-actions

    This issue is stale because it has been open for 180 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions