-
Notifications
You must be signed in to change notification settings - Fork 213
chore(e2e): adding localization to nightly jobs #4020
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
teknaS47
wants to merge
7
commits into
redhat-developer:main
Choose a base branch
from
teknaS47:localization-it-jp
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.
+1,384
−26
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
db9ae4a
adding localization to nightly jobs
teknaS47 e505afd
Merge branch 'main' into localization-it-jp
teknaS47 683c6ae
changing user settings persistence to browser
teknaS47 75698a7
Merge branch 'main' into localization-it-jp
teknaS47 edff4e2
adding rulesync generated files
teknaS47 657d4bd
Merge branch 'main' into localization-it-jp
teknaS47 8c54675
adding artifact dir
teknaS47 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
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,205 @@ | ||
| --- | ||
| paths: 'catalog-entities/extensions/**, docs/dynamic-plugins/**' | ||
| --- | ||
| # RHDH Extensions Catalog - Plugin Metadata Workflow | ||
|
|
||
| This cursor rule provides an automated workflow for adding dynamic plugin metadata to the RHDH Extensions Catalog. | ||
|
|
||
| ## Important Documentation | ||
|
|
||
| **Primary Reference**: Read `catalog-entities/extensions/README.md` for: | ||
| - Detailed YAML structure and field explanations | ||
| - Complete examples (3scale plugin) | ||
| - RHDH-local testing setup | ||
| - Troubleshooting guide | ||
|
|
||
| This rule focuses on the **workflow automation** and **validation** aspects not covered in the README. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| Before starting, ensure you have: | ||
|
|
||
| 1. **Successfully exported plugin** from [RHDH Plugin Export Overlays](https://github.com/redhat-developer/rhdh-plugin-export-overlays) | ||
| - OCI URL from build output (e.g., `oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/aws-ecs:pr_1426__0.6.0!aws-ecs`) | ||
| - Plugin version and integrity information | ||
|
|
||
| 2. **Required tools installed**: | ||
| ```bash | ||
| # Check if tools are installed | ||
| command -v yq &> /dev/null || echo "❌ Install yq (Go version): brew install yq (macOS) or snap install yq (Linux)" | ||
| command -v ajv &> /dev/null || echo "❌ Install ajv-cli: npm install -g ajv-cli" | ||
| command -v gh &> /dev/null || echo "❌ Install GitHub CLI: brew install gh (macOS)" | ||
| ``` | ||
|
|
||
| **Important**: Ensure you have the **Go-based version of yq** (mikefarah/yq), not the Python version (kislyuk/yq). | ||
| Verify with: `yq --version` (should show "mikefarah/yq") | ||
|
|
||
| ## Interactive Information Gathering | ||
|
|
||
| When adding a plugin, gather the following information: | ||
|
|
||
| ### Required Information | ||
| 1. **Plugin Identification** | ||
| - Plugin name (e.g., `aws-ecs`, `todo`) | ||
| - NPM package name (e.g., `@aws/amazon-ecs-plugin-for-backstage`) | ||
| - Namespace (e.g., `rhdh` for Red Hat maintained, `community` for community plugins) | ||
|
|
||
| 2. **Technical Details** | ||
| - OCI URL from overlay build | ||
| - Plugin version | ||
| - Backstage version compatibility | ||
| - Role: `frontend-plugin` or `backend-plugin` | ||
|
|
||
| 3. **User-Facing Information** | ||
| - Title and short description (2-3 lines for tile view) | ||
| - Long description (markdown, for expanded view) | ||
| - Category (one of: AI, Analytics, CI/CD, Cloud, Compliance, Cost, Developer Tools, Docs, Feature Flags, Kubernetes, Monitoring, Productivity, Reporting, Search, Security, Storage, Supply Chain, Testing) | ||
| - Tags (lowercase, kebab-case) | ||
| - Support level: `production`, `tech-preview`, or `dev-preview` | ||
|
|
||
| 4. **Links** | ||
| - Homepage/documentation URL | ||
| - Source code repository | ||
| - Bug tracker URL | ||
|
|
||
| ## Workflow Steps | ||
|
|
||
| ### Step 1: Create Feature Branch | ||
|
|
||
| ```bash | ||
| # Ensure we're on latest main | ||
| git fetch origin && git checkout main && git pull origin main | ||
|
|
||
| # Create feature branch | ||
| git checkout -b add-{plugin-name}-plugin-metadata | ||
| ``` | ||
|
|
||
| ### Step 2: Tool Verification | ||
|
|
||
| ```bash | ||
| # Verify required tools | ||
| for tool in yq ajv gh; do | ||
| command -v $tool &> /dev/null && echo "✓ $tool installed" || echo "❌ $tool missing" | ||
| done | ||
|
|
||
| # Verify yq is the Go version | ||
| yq --version | grep -q "mikefarah" && echo "✓ yq is Go version (mikefarah/yq)" || echo "❌ Wrong yq version - install mikefarah/yq" | ||
| ``` | ||
|
|
||
| ### Step 3: Create/Edit Plugin Metadata | ||
|
|
||
| Create `catalog-entities/extensions/plugins/{plugin-name}.yaml`: | ||
| - Use `catalog-entities/extensions/plugins/3scale.yaml` as a template | ||
| - See README for complete field descriptions | ||
|
|
||
| ### Step 4: Validate Files | ||
|
|
||
| ```bash | ||
| # Navigate to extensions directory | ||
| cd catalog-entities/extensions | ||
|
|
||
| # Download schemas to temp directory (ajv doesn't support remote schemas well) | ||
| mkdir -p /tmp/rhdh-schemas | ||
| curl -s "https://raw.githubusercontent.com/redhat-developer/rhdh-plugins/main/workspaces/extensions/json-schema/packages.json" \ | ||
| -o /tmp/rhdh-schemas/packages.json | ||
| curl -s "https://raw.githubusercontent.com/redhat-developer/rhdh-plugins/main/workspaces/extensions/json-schema/plugins.json" \ | ||
| -o /tmp/rhdh-schemas/plugins.json | ||
|
|
||
| # Convert YAML to JSON and validate Package against local schema | ||
| echo "Validating packages/{plugin-name}.yaml..." | ||
| yq eval packages/{plugin-name}.yaml -o json > /tmp/rhdh-schemas/package-temp.json | ||
| ajv validate -s /tmp/rhdh-schemas/packages.json -d /tmp/rhdh-schemas/package-temp.json | ||
|
|
||
| # Convert YAML to JSON and validate Plugin against local schema | ||
| echo "Validating plugins/{plugin-name}.yaml..." | ||
| yq eval plugins/{plugin-name}.yaml -o json > /tmp/rhdh-schemas/plugin-temp.json | ||
| ajv validate -s /tmp/rhdh-schemas/plugins.json -d /tmp/rhdh-schemas/plugin-temp.json | ||
|
|
||
| # Clean up temp files | ||
| rm /tmp/rhdh-schemas/package-temp.json /tmp/rhdh-schemas/plugin-temp.json | ||
| ``` | ||
|
|
||
| **Note**: This uses the Go-based `yq` syntax (`yq eval file.yaml -o json`). If validation fails, check that you have the correct yq version installed. | ||
|
|
||
| ### Step 5: Test Locally (Optional) | ||
|
|
||
| Follow the RHDH-local testing instructions in the README: | ||
| 1. Clone `rhdh-local` repository | ||
| 2. Mount your local catalog in `compose.yaml` | ||
| 3. Set `catalog.processingInterval: { seconds: 15 }` in `app-config.yaml` | ||
| 4. Start with `docker compose up -d` | ||
| 5. Check http://localhost:7007 → Catalog → Extensions | ||
|
|
||
| ### Step 6: Create Pull Request | ||
|
|
||
| ```bash | ||
| # Stage changes | ||
| git add catalog-entities/extensions/packages/{plugin-name}.yaml | ||
| git add catalog-entities/extensions/plugins/{plugin-name}.yaml | ||
|
|
||
| # Commit with descriptive message | ||
| git commit -m "feat: add {plugin-name} plugin to RHDH extensions | ||
|
|
||
| - Added Package entity with OCI URL and version | ||
| - Added Plugin entity with description and metadata | ||
|
|
||
| # Create PR | ||
| gh pr create --title "feat: add {plugin-name} plugin to extensions" \ | ||
| --body "## Summary | ||
| - Added {plugin-name} plugin metadata to Extensions Catalog | ||
| - Package: \`{npm-package-name}\` version {version} | ||
| - Support level: {support-level} | ||
|
|
||
| ## Checklist | ||
| - [ ] Package and Plugin YAML files created | ||
| - [ ] Schemas validate successfully | ||
| - [ ] Tested locally with rhdh-local (if applicable)" | ||
| ``` | ||
|
|
||
| ## Validation Checklist | ||
|
|
||
| Before submitting: | ||
| - [ ] Tools installed (`yq` Go version, `ajv-cli`, `gh`) | ||
| - [ ] Package YAML validates against schema | ||
| - [ ] Plugin YAML validates against schema | ||
| - [ ] Namespace consistent between Package and Plugin | ||
| - [ ] OCI URL correctly formatted | ||
| - [ ] All required fields populated | ||
|
|
||
| ## Common Issues | ||
|
|
||
| ### Schema Validation Fails | ||
| ```bash | ||
| # Debug by checking JSON conversion (using Go-based yq) | ||
| yq eval your-file.yaml -o json | jq '.' | ||
|
|
||
| # Common issues: | ||
| # - Missing required fields | ||
| # - Wrong field types | ||
| # - Invalid enum values (e.g., wrong category) | ||
| ``` | ||
|
|
||
| ### Wrong yq Version | ||
| ```bash | ||
| # Check if you have the Go version | ||
| yq --version | ||
|
|
||
| # Should show: yq (https://github.com/mikefarah/yq/) version X.X.X | ||
|
|
||
| # If you have the Python version (kislyuk/yq), uninstall and install Go version: | ||
| # macOS: brew install mikefarah/yq/yq | ||
| # Linux: snap install yq | ||
| ``` | ||
|
|
||
| ### OCI URL Format | ||
| Correct format: `oci://registry/path:tag!package-name` | ||
| - Must include `!package-name` suffix | ||
| - Tag typically includes PR number and version | ||
|
|
||
| ## References | ||
|
|
||
| - [README with detailed documentation](../../catalog-entities/extensions/README.md) | ||
| - [Extension Schemas](https://github.com/redhat-developer/rhdh-plugins/tree/main/workspaces/extensions/json-schema) | ||
| - [RHDH Local Testing](https://github.com/redhat-developer/rhdh-local) | ||
| - [Dynamic Plugins Documentation](https://docs.redhat.com/en/documentation/red_hat_developer_hub) | ||
| - [RHDH Plugin Catalog](https://gitlab.cee.redhat.com/rhidp/rhdh-plugin-catalog/-/blob/rhdh-1-rhel-9/catalog-index) (RH VPN Required) |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Thank you for fixing the inconsistencies caused by the force merge of #3992!
The RuleSync check is now broken because of the update in #3793.
Feel free to fix it by running
yarn rulesync:generateand committing the files generated.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.
Thanks! I’ve already regenerated the RuleSync files and committed the updates.
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.
Please push the updates. I don't see them here yet