Skip to content

Commit f958889

Browse files
Merge pull request #69 from davidesalerno/openshiftBumpDeps
feat: new slash command to bump deps on projects belonging to OpenShi…
2 parents db15fe4 + b38a3cf commit f958889

File tree

3 files changed

+596
-1
lines changed

3 files changed

+596
-1
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,20 @@ See [plugins/jira/README.md](plugins/jira/README.md) for full documentation.
103103

104104
General-purpose utilities for development workflows:
105105
- **PR Test Generation** (`/utils:generate-test-plan`) - Generate test steps for one or more related PRs
106+
- **Process Renovate PRs** (`/utils:process-renovate-pr`) - Process Renovate dependency PRs to meet repository standards
106107

107108
See [plugins/utils/commands/generate-test-plan.md](plugins/utils/commands/generate-test-plan.md) for full documentation.
108109

110+
### OpenShift Plugin
111+
112+
OpenShift development workflow automation:
113+
- **E2E Test Generation** (`/openshift:new-e2e-test`) - Generate end-to-end tests for OpenShift features
114+
- **Rebase** (`/openshift:rebase`) - Rebases git repository in the current working directory to a new upstream release specified
115+
- **Create Cluster** (`/openshift:create-cluster`) - Automates the process of extracting the OpenShift installer from a release image
116+
- **Dependency Bumping** (`/openshift:bump-deps`) - Bump dependencies with automated analysis, testing, and PR creation
117+
118+
- See [plugins/openshift/README.md](plugins/openshift/README.md) for full documentation.
119+
109120
## Plugin Development
110121

111122
Want to contribute or create your own plugins? Check out the `plugins/` directory for examples.

plugins/openshift/README.md

Lines changed: 163 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,173 @@ Rebase an OpenShift fork of an upstream repository to a new upstream release.
1414

1515
This command automates the complex process of rebasing OpenShift forks following the UPSTREAM commit conventions.
1616

17+
### `/openshift:bump-deps`
18+
19+
Automates the process of bumping dependencies in OpenShift organization projects. It analyzes the dependency, determines
20+
the appropriate version to bump to, updates the necessary files (go.mod, go.sum, package.json, etc.), runs tests,
21+
and optionally creates Jira tickets and pull requests.
22+
1723
See the [commands/](commands/) directory for full documentation of each command.
1824

1925
## Installation
2026

27+
### From the Claude Code Plugin Marketplace
28+
29+
1. **Add the marketplace** (if not already added):
30+
```bash
31+
/plugin marketplace add openshift-eng/ai-helpers
32+
```
33+
34+
2. **Install the openshift plugin**:
35+
```bash
36+
/plugin install openshift@ai-helpers
37+
```
38+
39+
3. **Use the commands**:
40+
```bash
41+
/openshift:bump-deps k8s.io/api
42+
```
43+
44+
## Available Commands
45+
46+
### E2E Test Generation
47+
48+
#### `/openshift:new-e2e-test` - Generate E2E Tests
49+
50+
Generate end-to-end tests for OpenShift features.
51+
52+
See [commands/new-e2e-test.md](commands/new-e2e-test.md) for full documentation.
53+
54+
### Dependency Bumping
55+
56+
#### `/openshift:bump-deps` - Bump Dependencies
57+
58+
Automates dependency updates in OpenShift projects with comprehensive analysis, testing, and optional Jira ticket and PR creation.
59+
60+
**Basic Usage:**
2161
```bash
22-
/plugin install openshift@ai-helpers
62+
# Bump to latest version
63+
/openshift:bump-deps k8s.io/api
64+
65+
# Bump to specific version
66+
/openshift:bump-deps golang.org/x/net v0.20.0
67+
68+
# Bump with Jira ticket
69+
/openshift:bump-deps github.com/spf13/cobra --create-jira
70+
71+
# Bump with Jira ticket and PR
72+
/openshift:bump-deps github.com/prometheus/client_golang --create-jira --create-pr
2373
```
2474

75+
**Supported Dependency Types:**
76+
- Go modules (go.mod)
77+
- npm packages (package.json)
78+
- Container images (Dockerfile)
79+
- Python packages (requirements.txt, pyproject.toml)
80+
81+
**Key Features:**
82+
- Automatic version discovery and compatibility checking
83+
- Changelog and breaking change analysis
84+
- Automated testing (unit, integration, e2e)
85+
- Jira ticket creation with comprehensive details
86+
- Pull request creation with proper formatting
87+
- Handles direct and indirect dependencies
88+
- Security vulnerability detection
89+
- Batch updates for related dependencies
90+
91+
**Arguments:**
92+
- `<dependency>` (required): Package identifier (e.g., `k8s.io/api`, `@types/node`)
93+
- `[version]` (optional): Target version (defaults to latest stable)
94+
- `--create-jira`: Create a Jira ticket for the update
95+
- `--create-pr`: Create a pull request (implies --create-jira)
96+
- `--jira-project <PROJECT>`: Specify Jira project (default: auto-detect)
97+
- `--component <COMPONENT>`: Specify Jira component (default: auto-detect)
98+
- `--skip-tests`: Skip running tests (creates draft PR)
99+
- `--force`: Force update even if tests fail
100+
101+
**Examples:**
102+
103+
1. Simple bump to latest:
104+
```bash
105+
/openshift:bump-deps k8s.io/client-go
106+
```
107+
108+
2. Bump with custom Jira project:
109+
```bash
110+
/openshift:bump-deps sigs.k8s.io/controller-runtime --create-jira --jira-project OCPBUGS
111+
```
112+
113+
3. Bump container image:
114+
```bash
115+
/openshift:bump-deps registry.access.redhat.com/ubi9/ubi-minimal
116+
```
117+
118+
4. Batch update Kubernetes dependencies:
119+
```bash
120+
/openshift:bump-deps "k8s.io/*"
121+
```
122+
123+
See [commands/bump-deps.md](commands/bump-deps.md) for full documentation.
124+
125+
## Development
126+
127+
### Adding New Commands
128+
129+
To add a new command to this plugin:
130+
131+
1. Create a new markdown file in `commands/`:
132+
```bash
133+
touch plugins/openshift/commands/your-command.md
134+
```
135+
136+
2. Follow the structure from existing commands (see `commands/bump-deps.md` for reference)
137+
138+
3. Include these sections:
139+
- Name
140+
- Synopsis
141+
- Description
142+
- Implementation
143+
- Return Value
144+
- Examples
145+
- Arguments
146+
- Error Handling
147+
- Notes
148+
149+
4. Test your command:
150+
```bash
151+
/openshift:your-command
152+
```
153+
154+
### Plugin Structure
155+
156+
```
157+
plugins/openshift/
158+
├── .claude-plugin/
159+
│ └── marketplace.json # Plugin metadata
160+
├── commands/
161+
│ ├── bump-deps.md # Dependency bumping command
162+
│ ├── new-e2e-test.md # E2E test generation
163+
│ └── ... # Additional commands
164+
└── README.md # This file
165+
```
166+
167+
## Related Plugins
168+
169+
- **utils** - General utilities including `process-renovate-pr` for processing Renovate PRs
170+
- **jira** - Jira automation and issue management
171+
- **git** - Git workflow automation
172+
- **ci** - OpenShift CI integration
173+
174+
## Contributing
175+
176+
Contributions are welcome! When adding new OpenShift-related commands:
177+
178+
1. Ensure the command is specific to OpenShift development workflows
179+
2. Follow the existing command structure and documentation format
180+
3. Include comprehensive examples and error handling
181+
4. Test with real OpenShift projects
182+
5. Update this README with new command documentation
183+
184+
## License
185+
186+
See [LICENSE](../../LICENSE) for details.

0 commit comments

Comments
 (0)