imbajin commented on code in PR #360: URL: https://github.com/apache/hugegraph-computer/pull/360#discussion_r3975767859
########## .github/workflows/commit-check.yml: ########## @@ -0,0 +1,54 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +name: "Commit & PR Title Validation" + +on: + pull_request: + types: + - opened + - edited + - synchronize + - reopened + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + validate-pr-title: + name: Validate PR Title & Format + runs-on: ubuntu-latest + permissions: + pull-requests: read + steps: + - name: Validate PR Title Format + uses: amannn/action-semantic-pull-request@v5 Review Comment: ⚠️ important — This workflow only validates the PR title. The selected action's legacy `validateSingleCommit` option is absent (and only covers single-commit PRs), and no other step checks commit messages. Please add a commit-message validator or narrow the workflow name and documentation to PR-title validation. ########## docs/automation-guide.md: ########## @@ -0,0 +1,72 @@ +<!-- +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +# Automation & Code Quality Guide + +This guide details the repository automations and code quality tools configured for **HugeGraph Computer** and **Vermeer** as recommended in Automation Analysis [#320](https://github.com/apache/hugegraph-computer/issues/320). + +--- + +## Code Quality & Formatting Automations Review Comment: ⚠️ important — This section promises code-formatting automation, but the exact-head diff adds no formatter plugin or `spotless:check`/equivalent CI step; the only documented checks here are Checkstyle and RAT, which validate rather than format. Please add and wire a formatter, or remove the formatting claim so the guide matches what the repository enforces. ########## docs/automation-guide.md: ########## @@ -0,0 +1,72 @@ +<!-- +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +# Automation & Code Quality Guide + +This guide details the repository automations and code quality tools configured for **HugeGraph Computer** and **Vermeer** as recommended in Automation Analysis [#320](https://github.com/apache/hugegraph-computer/issues/320). + +--- + +## Code Quality & Formatting Automations + +### 1. Code Style & License Checks +- **Checkstyle (`maven-checkstyle-plugin`):** Enforces Java coding style guidelines defined in `checkstyle.xml`. +- **Apache RAT (`apache-rat-plugin`):** Verifies Apache license headers across all project source files. + +```bash +# Run Checkstyle validation +mvn checkstyle:check + +# Run Apache RAT license validation +mvn apache-rat:check +``` + +### 2. Test Coverage (`jacoco-maven-plugin`) +JaCoCo tracks unit and integration test coverage during build execution. + +```bash +# Run unit tests and generate JaCoCo coverage report +mvn test -P unit-test + +# Inspect generated report at: +# target/site/jacoco/jacoco.xml +``` + +--- + +## CI/CD Workflows + +| Workflow | Path | Trigger | Description | +|----------|------|---------|-------------| +| **Commit Check** | `.github/workflows/commit-check.yml` | Pull Request | Validates PR titles against Conventional Commits formatting rules. | +| **Computer CI** | `.github/workflows/computer-ci.yml` | Push / PR | Compiles, runs RAT, HDFS, K8s, and Java unit/integration tests. | +| **Vermeer CI** | `.github/workflows/vermeer-ci.yml` | Push / PR | Builds Vermeer Go binary, checks UI assets, and tests Docker builds. | +| **Release Notes** | `.github/workflows/release-notes.yml` | Tag Push (`*.*.*`) | Automatically drafts GitHub release notes from git history. | + +--- + +## PR Title Guidelines + +Pull requests must follow the Conventional Commits specification: + +`<type>(<scope>): <short summary>` Review Comment: 🧹 minor — The guide presents `<scope>` as mandatory, but the workflow sets `requireScope: false`, so a valid title can be `fix: ...`. Please use optional-scope notation or set `requireScope` to true so the documented rule matches CI. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
