-
Notifications
You must be signed in to change notification settings - Fork 6
chore: AgentReady improvements #459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mkuznyetsov
wants to merge
1
commit into
main
Choose a base branch
from
agentready-devgen
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "extends": ["@commitlint/config-conventional"], | ||
| "rules": { | ||
| "type-enum": [ | ||
| 2, | ||
| "always", | ||
| [ | ||
| "build", | ||
| "ci", | ||
| "docs", | ||
| "feat", | ||
| "fix", | ||
| "perf", | ||
| "refactor", | ||
| "revert", | ||
| "style", | ||
| "test", | ||
| "chore" | ||
| ] | ||
| ], | ||
| "subject-case": [2, "never", ["upper-case"]], | ||
| "header-max-length": [2, "always", 100] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| # DevWorkspace Generator | ||
|
|
||
| ## Overview | ||
| This library generates DevWorkspace components and templates for Eclipse Che. It transforms devfile.yaml specifications and editor definitions into Kubernetes DevWorkspace custom resources. | ||
|
|
||
| Published as [@eclipse-che/che-devworkspace-generator](https://www.npmjs.com/package/@eclipse-che/che-devworkspace-generator) on npm. | ||
|
|
||
| ## Architecture | ||
| - **TypeScript library** with InversifyJS dependency injection | ||
| - **Main entry**: `src/entrypoint.ts` - exports generator functions | ||
| - **Core generator**: `src/main.ts` - orchestrates devfile parsing and DevWorkspace generation | ||
| - **API models**: Uses `@devfile/api` for Kubernetes DevWorkspace resource types | ||
| - **YAML processing**: `js-yaml` for parsing and serialization | ||
|
|
||
| ## Development | ||
|
|
||
| ### Quick Start | ||
| ```bash | ||
| # One-command setup for development | ||
| yarn setup | ||
|
|
||
| # Or manually: | ||
| yarn install && yarn compile && yarn test | ||
| ``` | ||
|
|
||
| ### Setup | ||
| ```bash | ||
| yarn install # Install all dependencies | ||
| ``` | ||
|
|
||
| ### Build | ||
| ```bash | ||
| yarn build # Full build: format, compile, lint, test | ||
| yarn compile # TypeScript compilation only | ||
| ``` | ||
|
|
||
| ### Testing | ||
| ```bash | ||
| yarn test # Run Jest test suite with coverage | ||
| yarn lint # ESLint checks | ||
| yarn format # Prettier format check | ||
| yarn format:fix # Auto-format code | ||
| yarn lint:fix # Auto-fix lint issues | ||
| ``` | ||
|
|
||
| ### Single-File Verification | ||
| Use these commands to verify individual files quickly (< 5 seconds): | ||
|
|
||
| ```bash | ||
| # Lint a single file | ||
| npx eslint <path/to/file.ts> | ||
|
|
||
| # Type-check a single file | ||
| npx tsc --noEmit <path/to/file.ts> | ||
|
|
||
| # Format check a single file | ||
| npx prettier --check <path/to/file.ts> | ||
| ``` | ||
|
|
||
| ## Coding Standards | ||
| - **TypeScript strict mode** enabled in tsconfig.json | ||
| - **100% test coverage** required (branches, functions, lines, statements) | ||
| - **Prettier** for consistent formatting (120 char line width, single quotes) | ||
| - **ESLint** for code quality | ||
| - **No implicit any** types | ||
| - **Explicit type annotations** for function parameters and return types | ||
| - **Conventional commits** - Use format: `type(scope): subject` | ||
| - Types: feat, fix, docs, style, refactor, test, chore, ci, build, perf, revert | ||
| - Example: `feat: add gitlab resolver`, `fix: handle null in bitbucket url parser` | ||
|
|
||
| ## CI/CD | ||
| Pull requests must pass: | ||
| - License compliance checks | ||
| - ESLint validation | ||
| - TypeScript type checking | ||
| - Jest test suite with full coverage | ||
|
|
||
| ## Pattern References | ||
|
|
||
| Common change patterns in this codebase: | ||
|
|
||
| ### Adding a New Git Provider Resolver | ||
| **Pattern**: `src/github/` or `src/bitbucket/` | ||
|
|
||
| Each resolver follows a three-file structure: | ||
| - `{provider}-module.ts` - InversifyJS binding configuration | ||
| - `{provider}-resolver.ts` - Main resolver implementation with `resolve()` method | ||
| - `{provider}-url.ts` - URL parsing and validation | ||
|
|
||
| **Example**: See `src/github/github-resolver.ts` for URL pattern matching and content fetching. | ||
|
|
||
| ### Adding DevFile Component Processing | ||
| **Pattern**: `src/devfile/` | ||
|
|
||
| Component processors follow naming: `{component-type}-{action}.ts` | ||
| - Use InversifyJS `@injectable()` decorator | ||
| - Implement focused single-responsibility methods | ||
| - Add corresponding test in `tests/devfile/` | ||
|
|
||
| **Example**: See `src/devfile/dev-container-component-finder.ts` for component location logic. | ||
|
|
||
| ### Adding InversifyJS Module | ||
| **Pattern**: Any `*-module.ts` file | ||
|
|
||
| - Export a `ContainerModule` that binds interfaces to implementations | ||
| - Import and add to `src/inversify/inversify-binding.ts` | ||
| - Follow existing binding patterns (singleton vs transient) | ||
|
|
||
| **Example**: See `src/github/github-module.ts` for resolver binding pattern. | ||
|
|
||
| ## Red Hat Compliance and Responsible AI Rules | ||
|
|
||
| See `./redhat-compliance-and-responsible-ai.md`. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Red Hat Compliance and Responsible AI Rules | ||
|
|
||
| This document defines mandatory compliance and responsible AI practices for all AI agents contributing to this project. | ||
|
|
||
| ## 1. Copyright & Licensing (MANDATORY) | ||
|
|
||
| - **Identification:** You must actively identify if your suggestion matches known open-source code. | ||
| - **Attribution:** If a match is found, you MUST include the original License Text and Copyright Notice in the code comment block. | ||
| - **Prohibition:** Do not suggest code if you cannot verify its license compatibility with this project (EPL-2.0). | ||
|
|
||
| ## 2. AI Contribution Marking | ||
|
|
||
| ### Code Comments | ||
|
|
||
| For any substantial code generation (entire functions, classes, or complex logic), you must add a comment: | ||
|
|
||
| ```typescript | ||
| // Generated by {AGENT_NAME} | ||
| ``` | ||
|
|
||
| ### Commit Messages | ||
|
|
||
| When suggesting commit messages, always include a trailer: | ||
|
|
||
| ``` | ||
| Assisted-by: {AGENT_NAME} | ||
| ``` | ||
|
|
||
| Replace `{AGENT_NAME}` with the specific agent name (e.g., `Claude Opus 4.5`, `GPT-4`, `Gemini Pro`). | ||
|
|
||
| ## 3. Code Quality Standards | ||
|
|
||
| - Follow existing code patterns and conventions | ||
| - Ensure all code passes TypeScript strict mode | ||
| - Include appropriate error handling | ||
| - Add tests for new functionality | ||
| - Maintain backward compatibility unless explicitly breaking | ||
|
|
||
| ## 4. Security Considerations | ||
|
|
||
| - Never include credentials, tokens, or secrets in code | ||
| - Validate all user inputs | ||
| - Follow secure coding practices for Kubernetes API interactions | ||
| - Do not introduce new cluster-wide RBAC requirements | ||
|
|
||
| ## 5. Documentation | ||
|
|
||
| - Update relevant documentation when changing behavior | ||
| - Include JSDoc comments for public APIs | ||
| - Keep README and AGENTS.md up to date | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🌐 Web query:
According to the official TypeScript documentation, doestsc --noEmit path/to/file.tsload compiler options from tsconfig.json when explicit input files are provided?💡 Result:
According to the official TypeScript documentation, no,
tsc --noEmit path/to/file.tsdoes not load compiler options fromtsconfig.jsonwhen explicit input files are provided [1][2][3]. The documentation explicitly states that when input files are specified on the command line,tsconfig.jsonfiles are ignored [1][2][3]. In this scenario, the compiler uses its default settings instead of the configuration defined in your project'stsconfig.json[4][5][6]. If you need to use specific compiler options while compiling individual files, you should use the--project(or-p) flag to point to your configuration file [4][2]. However, be aware that when you specify input files, theincludeandexcludesettings within thattsconfig.jsonare generally ignored, as the command-line arguments take precedence over the project configuration [3][7].Citations:
🤖 get_repo_knowledge executed:
get_repo_knowledge devfile/devworkspace-generator /tmp/coderabbit-repo-knowledge/devfile-devworkspace-generator-33828ae6Length of output: 574
🏁 Script executed:
Repository: devfile/devworkspace-generator
Length of output: 3102
Apply strict checks to the single-file command.
When explicit input files are supplied,
tscignorestsconfig.json. This command can omit the repository’s strict compiler options. Add--strict, or document a focused project configuration that extendstsconfig.json.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents