跳到正文
cccskills
免费在 GitHub 公开中文介绍

gh-pull-request

在推送前检查构建、Checkstyle、许可证标头和 Java 类名写法,修复问题后提交并推送分支;若当前分支尚无 PR,则按项目模板创建。

原文查看原文说明

Verify, commit, and push changes on a PR branch. Runs pre-flight checks (compile, checkstyle, license headers) before every push. Also creates the PR if one doesn't exist yet.

apache/skywalking星标 24,978(GitHub 24,978 + cccskills 0)
集成工具GitHub

实测评分 未实测

查看安装方法

适用场景

  • 提交 PR 前检查改动
  • 提交并推送分支改动
  • 从当前分支创建 PR

中文介绍

功能

在推送 PR 分支上的改动前,本技能会按步骤检查编译、Checkstyle、许可证标头,以及 Java 文件中是否使用了不必要的全限定类名。发现问题后先修正并重新检查,通过后再提交并推送。如果当前分支还没有 PR,则参考项目模板创建 PR,并添加指定的审阅者。PR 合并后,还会指导你确认改动已进入默认分支,再整理本地分支。

适用场景

准备提交 PR 时,可用它从构建和许可证检查一直推进到提交、推送;合并之后也可据此确认改动并清理本地分支。

使用示例

  • “请检查这些改动,然后提交并推送到 PR 分支。”
  • “如果这个分支还没有 PR,请按模板创建一个。”
  • “请确认已合并的改动,并整理本地分支。”

注意事项

需要使用项目的 Maven 包装器、license-eye、Git 和 gh。创建 PR 时会参考 .github/PULL_REQUEST_TEMPLATE。请在工作分支上操作,不要直接在 master 上工作。

本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。

文档检查

AI 根据 SKILL.md 的内容检查了需要注意的操作和使用前提。评分只依据实际运行的结果(实测对比)。

安全性发送数据、删除文件、执行命令等是否有说明
B部分不足资料要求勿在 master 上操作并先确认合并,但也会推送和删除分支。
安装难易度所需工具和 API 密钥是否少且有说明
B部分不足资料提到 Maven 包装器、license-eye、Git、gh,但未写安装步骤。

不计入评分。 由 AI(OpenAI Codex)于 2026年10月29日 评估。仅供参考,安装前请同时查看原文。

如果您认为评估有误,请申请复核

请写明哪一项有误以及原因。无需登录。我们会对照 SKILL.md 重新评估,并在此处更新结果。

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

包含的文件(1)

  • SKILL.md6.5 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

PR Branch Workflow

Run pre-flight checks, commit, push, and optionally create a PR.

Pre-flight checks

Run these checks before every commit+push and fix any failures:

1. Compile and checkstyle

# Checkstyle
./mvnw -B -q clean checkstyle:check

# Full build (compile + javadoc)
./mvnw clean flatten:flatten install javadoc:javadoc -B -q -Pall \
  -Dmaven.test.skip \
  -Dcheckstyle.skip \
  -Dgpg.skip

2. License header check

license-eye header check

If invalid files are found, fix with license-eye header fix and re-check.

3. Unnecessary fully-qualified class names

The project checkstyle forbids inline FQCNs — every type reference in code should resolve through an import, not a fully-qualified name. Checkstyle does not always catch this (it misses cases like inline java.util.HashMap, java.util.concurrent.TimeUnit, or org.apache.skywalking.oap.server.telemetry.api.HistogramMetrics.Timer used as a local variable type, generic parameter, or new target). Audit the files the branch touched before pushing:

Use the Grep tool (ripgrep) rather than BSD grep on macOS — the scan below relies on a negative lookahead that BSD grep doesn't support and GNU grep -P does:

pattern: ^(?!\s*(import |package |\s*\*)).*\b(java\.util\.|java\.io\.|java\.nio\.|java\.util\.concurrent\.|javassist\.|org\.apache\.skywalking\.)[A-Z][A-Za-z0-9_]*
glob:    *.java
output_mode: content
-n: true

Scope the scan to files the branch touched, not the whole tree — pre-existing FQDNs on unrelated files generate noise. Use git diff --name-only master...HEAD -- '*.java' to get the changed list, then run the ripgrep pattern against each.

Acceptable exceptions (same as the CLAUDE.md rule):

  • Two classes with the same simple name would collide if both imported.
  • A Javadoc {@link} where the short name would be ambiguous to the reader.
  • Inside a string literal (e.g., a class name passed to Class.forName).

Fix every other hit — add an import and switch to the short name. This includes new java.util.HashMap<>(), java.util.Set<String> parameter types, and org.apache.skywalking.oap.server.telemetry.api.HistogramMetrics.Timer as a local variable type. Field declarations, method signatures, local variables, and generic type arguments should all use the imported short name.

Re-run checkstyle after the fix — a sloppy sed/replace_all can corrupt the import line itself (e.g., turning import java.util.concurrent.locks.ReentrantLock; into import ReentrantLock;), which causes a cryptic checkstyle Range [0, -1) out of bounds for length N error, not a normal violation line. If you see that error, inspect the imports block first.

Commit and push

After checks pass, commit and push:

git add <files>
git commit -m "<message>"
git push -u origin <branch-name>

Branch strategy

  • Never work directly on master branch
  • If on master, create a new branch first: git checkout -b feature/<name> or git checkout -b fix/<name>

Create PR (if not yet created)

Check whether a PR already exists for the current branch:

gh pr view --json number 2>/dev/null

If no PR exists, create one:

PR title

Summarize the changes concisely. Examples:

  • Fix BanyanDB query timeout issue
  • Add support for OpenTelemetry metrics

PR description

Read .github/PULL_REQUEST_TEMPLATE and use its exact format with checkboxes. Do NOT use a custom summary format.

Key template sections — uncomment the relevant one:

For Bug Fixes:

### Fix <bug description or issue link>
- [ ] Add a unit test to verify that the fix works.
- [ ] Explain briefly why the bug exists and how to fix it.

For New Features:

### <Feature description>
- [ ] If this is non-trivial feature, paste the links/URLs to the design doc.
- [ ] Update the documentation to include this new feature.
- [ ] Tests(including UT, IT, E2E) are added to verify the new feature.
- [ ] If it's UI related, attach the screenshots below.

For Performance Improvements:

### Improve the performance of <class or module or ...>
- [ ] Add a benchmark for the improvement.
- [ ] The benchmark result.
- [ ] Links/URLs to the theory proof or discussion articles/blogs.

Always include:

- [ ] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #<issue number>.
- [ ] Update the [`CHANGES` log](https://github.com/apache/skywalking/blob/master/docs/en/changes/changes.md).

Create command

gh pr create --title "<title>" --body "$(cat <<'EOF'
<PR body from template>
EOF
)"

Post-creation

  • Add copilot as a reviewer: gh pr edit <number> --add-reviewer copilot
  • Do NOT add AI assistant as co-author. Code responsibility is on the committer's hands.
  • Return the PR URL when done.

After the PR is merged

Once the PR is merged, sync the default branch and clean up the feature branch:

# 1. Prune stale remote refs. GitHub auto-deletes the PR's branch on merge, so
#    the remote feature branch is usually already gone; --prune removes the
#    dangling local tracking ref.
git fetch origin --prune

# 2. Switch back to the default branch and fast-forward it to include the merge.
git checkout master
git pull --ff-only origin master

# 3. Confirm the change actually landed in master before deleting anything —
#    `git log --oneline -1` should show the merge/squash commit with the PR
#    number, or grep for a symbol the PR introduced.
git log --oneline -1

# 4. Delete the local feature branch. SkyWalking SQUASH-merges PRs, so the
#    feature branch's commit is NOT an ancestor of master (master gets a new
#    squash commit instead). `git branch -d` therefore reports "not fully
#    merged" — that is expected, not an error. After confirming the content is
#    in master (step 3), force-delete:
git branch -d <branch> 2>/dev/null || git branch -D <branch>

Notes:

  • git branch -d failing with "not fully merged" on a squash-merged PR is normal — the squash commit has a different SHA than the feature commit. Verify via step 3, then -D.
  • If the remote branch was not auto-deleted (some repo settings), remove it explicitly: git push origin --delete <branch>.
  • Do NOT skip step 3. Force-deleting a local branch whose work didn't actually merge loses it.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

ci-e2e-debug

免费有简介

用于排查 GitHub Actions 中失败的端到端测试。它会获取并解压运行日志,检查 OAP 及其他组件的错误,并整理可能的原因,包括独立测试进程中的故障。

  • 排查 GitHub Actions 中失败的端到端测试
  • 检查 OAP、BanyanDB 或 UI 日志
  • 追踪独立测试进程的故障
apache/skywalking2.5万2026年10月29日 更新

compile

免费有简介

通过 Maven 包装器构建 SkyWalking OAP,并检查 Javadoc 和 Checkstyle。可选择全量、后端、单个模块构建或单项检查,用于提交 PR 前验证改动。

  • 提交 PR 前运行全量构建
  • 检查 Javadoc 错误和警告
  • 只构建修改过的模块
apache/skywalking2.5万2026年10月29日 更新

generate-classes

免费有简介

编译 SkyWalking 的 MAL、OAL、LAL 或 Hierarchy DSL 脚本,并输出生成的 `.class` 文件供检查。可选择一种 DSL,也可生成全部四种,再用 `javap` 查看字节码。

  • 检查 MAL 表达式生成的类
  • 查看 OAL 指标和分发器类
  • 检查 LAL 或 Hierarchy 输出
apache/skywalking2.5万2026年10月29日 更新

license

免费有简介

用 `license-eye` 检查源文件的 Apache 2.0 标头和依赖许可证清单;可修复标头、重新生成清单,并在提交 PR 前核对差异。

  • 提交 PR 前检查 Apache 标头
  • 修复缺失的许可证标头
  • 核对依赖许可证清单差异
apache/skywalking2.5万2026年10月29日 更新

new-monitoring-feature

免费有简介

为 SkyWalking OAP 增加监控对象或 Layer 时,梳理不同信号对应的扩展点,并列出 Layer 注册、界面模板、文档和本地验证等相关工作。

  • 规划新增监控 Layer 的改动
  • 选择指标或日志的扩展点
  • 整理 Layer 相关界面和文档更新
apache/skywalking2.5万2026年10月29日 更新

package

免费

Rebuild SkyWalking’s distribution and OAP Docker image after source changes, choosing a command sequence that includes the updated JARs. It also explains how to inspect the image contents before running end-to-end tests.

中文简介正在准备中。当前显示英语简介。

  • Rebuilding an OAP image after Java source changes
  • Updating the distribution package before Docker builds
  • Checking that a fix reached the image before E2E tests
apache/skywalking2.5万2026年10月29日 更新

查看 apache 的全部技能

报告此技能的问题