From c8314db87ac625b98abfd54d1217053fca6834b3 Mon Sep 17 00:00:00 2001 From: Valerii Svydenko Date: Mon, 16 Mar 2026 11:05:31 +0200 Subject: [PATCH 1/3] chore: update devfile; add CONTRIBUTING.md Signed-off-by: Valerii Svydenko --- .devfile.yaml | 25 +++++--- .vscode/extensions.json | 3 +- CONTRIBUTING.md | 128 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 146 insertions(+), 10 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/.devfile.yaml b/.devfile.yaml index 8f4d90b..bca6c84 100644 --- a/.devfile.yaml +++ b/.devfile.yaml @@ -4,7 +4,7 @@ metadata: components: - name: builder container: - image: quay.io/devfile/universal-developer-image:ubi8-latest + image: quay.io/devfile/universal-developer-image:ubi10-latest memoryRequest: 256Mi memoryLimit: 3Gi cpuRequest: 100m @@ -15,24 +15,31 @@ commands: label: "1. Build" component: builder workingDir: ${PROJECTS_ROOT}/devworkspace-generator - commandLine: | - nvm use v${NODEJS_20_VERSION} - yarn && yarn format:fix && yarn build + commandLine: yarn && yarn format:fix && yarn build - id: test exec: label: "2. Run tests" component: builder workingDir: ${PROJECTS_ROOT}/devworkspace-generator - commandLine: | - nvm use v${NODEJS_20_VERSION} - yarn test + commandLine: yarn test + - id: license-check + exec: + label: "3. Check licenses" + component: builder + workingDir: ${PROJECTS_ROOT}/devworkspace-generator + commandLine: yarn license:check + - id: license-generate + exec: + label: "4. Generate licenses" + component: builder + workingDir: ${PROJECTS_ROOT}/devworkspace-generator + commandLine: yarn license:generate - id: generate-devworkspace exec: - label: "3. Generate DevWorkspace with Template" + label: "5. Generate DevWorkspace with Template" component: builder workingDir: ${PROJECTS_ROOT}/devworkspace-generator commandLine: | - nvm use v${NODEJS_20_VERSION} node lib/entrypoint.js \ --devfile-url:https://github.com/che-samples/java-spring-petclinic/tree/main \ --editor-url:https://raw.githubusercontent.com/eclipse-che/che-operator/refs/heads/main/editors-definitions/che-code-insiders.yaml \ diff --git a/.vscode/extensions.json b/.vscode/extensions.json index fdb2ba2..621017a 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -3,6 +3,7 @@ "dbaeumer.vscode-eslint", "redhat.vscode-yaml", "Orta.vscode-jest", - "cnshenj.vscode-task-manager" + "cnshenj.vscode-task-manager", + "RooVeterinaryInc.roo-cline" ] } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..4f54edc --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,128 @@ +# Contributing to DevWorkspace Generator + +Thank you for your interest in contributing to the DevWorkspace Generator! This document provides guidelines and instructions for contributing. + +## Reporting Issues + +Issues are tracked at [github.com/eclipse/che/issues](https://github.com/eclipse/che/issues). When filing a bug or feature request, please use the appropriate [issue template](https://github.com/devfile/devworkspace-generator/issues/new/choose). + +## Prerequisites + +- [Node.js](https://nodejs.org/) (LTS recommended) +- [Yarn](https://yarnpkg.com/) package manager + +## Getting Started + +1. Fork and clone the repository: + + ```bash + git clone https://github.com//devworkspace-generator.git + cd devworkspace-generator + ``` + +2. Install dependencies: + + ```bash + yarn install + ``` + +3. Build the project: + + ```bash + yarn build + ``` + + This runs formatting checks, compilation, linting, and tests. + +## Development Workflow + +### Building + +```bash +yarn compile # Compile TypeScript +yarn build # Full build (format + compile + lint + test) +yarn watch # Watch mode for incremental compilation +``` + +### Formatting + +The project uses [Prettier](https://prettier.io/) with the following configuration: +- Print width: 120 +- Single quotes +- Arrow parens: avoid + +```bash +yarn format # Check formatting +yarn format:fix # Auto-fix formatting issues +``` + +### Linting + +[ESLint](https://eslint.org/) is used for static analysis. + +```bash +yarn lint # Run linter +yarn lint:fix # Auto-fix lint issues +``` + +### Testing + +Tests are written with [Jest](https://jestjs.io/) and located in the `tests/` directory. + +```bash +yarn test # Run tests with coverage +``` + +**Important:** This project requires **100% code coverage** (branches, functions, lines, and statements). All new code must be fully covered by tests. + +## Submitting a Pull Request + +1. Create a branch for your changes: + + ```bash + git checkout -b my-feature + ``` + +2. Make your changes, ensuring: + - Code compiles without errors (`yarn compile`) + - Formatting passes (`yarn format`) + - Linting passes (`yarn lint`) + - All tests pass with 100% coverage (`yarn test`) + +3. Run the full build to verify everything: + + ```bash + yarn build + ``` + +4. Commit your changes and push to your fork. + +5. Open a pull request against the `main` branch. Fill out the [PR template](https://github.com/devfile/devworkspace-generator/blob/main/.github/PULL_REQUEST_TEMPLATE.md), which asks: + - What does this PR do? + - What issues does this PR fix or reference? + - Is it tested? How? + +## Project Structure + +``` +src/ +├── api/ # DevfileContext API types +├── bitbucket/ # Bitbucket Cloud URL resolver +├── bitbucket-server/ # Bitbucket Server URL resolver +├── devfile/ # Devfile processing (component finder/inserter) +├── devfile-schema/ # Devfile JSON schemas (2.0.0 – 2.3.0) +├── editor/ # Editor definition resolver +├── fetch/ # URL fetching utilities +├── github/ # GitHub URL resolver +├── inversify/ # Dependency injection bindings +├── resolve/ # Git URL resolution +├── entrypoint.ts # CLI entrypoint +├── generate.ts # DevWorkspace generation logic +├── main.ts # Library main export +└── types.ts # Shared types +tests/ # Test files mirroring src/ structure +``` + +## License + +This project is licensed under the [Apache License 2.0](LICENSE). By contributing, you agree that your contributions will be licensed under the same license. From b26b3e729547c2e173416b6f6630df86f0f175fa Mon Sep 17 00:00:00 2001 From: Valerii Svydenko Date: Mon, 16 Mar 2026 11:18:30 +0200 Subject: [PATCH 2/3] update generate devworkspace command Signed-off-by: Valerii Svydenko --- .devfile.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devfile.yaml b/.devfile.yaml index bca6c84..9204f9d 100644 --- a/.devfile.yaml +++ b/.devfile.yaml @@ -41,7 +41,7 @@ commands: workingDir: ${PROJECTS_ROOT}/devworkspace-generator commandLine: | node lib/entrypoint.js \ - --devfile-url:https://github.com/che-samples/java-spring-petclinic/tree/main \ + --devfile-url:https://github.com/che-incubator/quarkus-api-example/tree/main \ --editor-url:https://raw.githubusercontent.com/eclipse-che/che-operator/refs/heads/main/editors-definitions/che-code-insiders.yaml \ --output-file:/tmp/devworkspace-che-code-latest.yaml \ --injectDefaultComponent:true \ From 729c028d2bbc8eb137b1b34973a5c9dd7a622271 Mon Sep 17 00:00:00 2001 From: Valerii Svydenko Date: Mon, 16 Mar 2026 11:21:54 +0200 Subject: [PATCH 3/3] improve generate devworkspace command Signed-off-by: Valerii Svydenko --- .devfile.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.devfile.yaml b/.devfile.yaml index 9204f9d..7f00df3 100644 --- a/.devfile.yaml +++ b/.devfile.yaml @@ -40,9 +40,17 @@ commands: component: builder workingDir: ${PROJECTS_ROOT}/devworkspace-generator commandLine: | + DEFAULT_DEVFILE_URL="https://github.com/che-incubator/quarkus-api-example/tree/main" + DEFAULT_EDITOR_URL="https://raw.githubusercontent.com/eclipse-che/che-operator/refs/heads/main/editors-definitions/che-code-insiders.yaml" + echo "Enter devfile URL (default: ${DEFAULT_DEVFILE_URL}):" + read DEVFILE_URL + DEVFILE_URL="${DEVFILE_URL:-${DEFAULT_DEVFILE_URL}}" + echo "Enter editor URL (default: ${DEFAULT_EDITOR_URL}):" + read EDITOR_URL + EDITOR_URL="${EDITOR_URL:-${DEFAULT_EDITOR_URL}}" node lib/entrypoint.js \ - --devfile-url:https://github.com/che-incubator/quarkus-api-example/tree/main \ - --editor-url:https://raw.githubusercontent.com/eclipse-che/che-operator/refs/heads/main/editors-definitions/che-code-insiders.yaml \ + --devfile-url:"${DEVFILE_URL}" \ + --editor-url:"${EDITOR_URL}" \ --output-file:/tmp/devworkspace-che-code-latest.yaml \ --injectDefaultComponent:true \ --defaultComponentImage:registry.access.redhat.com/ubi8/openjdk-11:latest