Skip to content

[chore] Add sanity checks for docstring, license and DCO#10

Merged
0oshowero0 merged 6 commits intoAscend:mainfrom
0oshowero0:sanity
Jan 25, 2026
Merged

[chore] Add sanity checks for docstring, license and DCO#10
0oshowero0 merged 6 commits intoAscend:mainfrom
0oshowero0:sanity

Conversation

@0oshowero0
Copy link
Copy Markdown
Collaborator

@0oshowero0 0oshowero0 commented Jan 25, 2026

  1. DCO Check (.github/workflows/dco-check.yml): Added a GitHub Action workflow to ensure all commits contain a Signed-off-by line, complying with the Developer Certificate of Origin.
  2. Docstring Validation (check_docstrings.py): Added a script that checks for missing docstrings in modules/classes/functions exported via all. It supports an allow-list for exceptions.
  3. License Header Check (check_license.py): Added a script to scan source files and verify the presence of the required license header.

Signed-off-by: 0oshowero0 <o0shower0o@outlook.com>
Copilot AI review requested due to automatic review settings January 25, 2026 06:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds infrastructure for code quality checks including DCO (Developer Certificate of Origin) validation, license header verification, and docstring validation. It also adds Apache 2.0 license headers to multiple Python files that previously lacked them.

Changes:

  • Added DCO check workflow to validate signed-off-by lines in commits
  • Added sanity check workflow for license headers and docstrings
  • Added Python scripts to check license headers and docstrings
  • Added Apache 2.0 license headers to 7 existing Python files
  • Updated workflow branch configurations to include v0.* branches

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
.github/workflows/dco-check.yml New workflow to check DCO sign-offs on commits
.github/workflows/sanity.yml New workflow to run license and docstring checks
.github/workflows/python-package.yml Updated branch triggers to include v0.* branches
.github/workflows/pre-commit.yml Updated branch triggers to include v0.* branches
tests/sanity/check_license.py New script to verify Apache 2.0 license headers in Python files
tests/sanity/check_docstrings.py New script to check for missing docstrings in functions and classes
transfer_queue/storage/managers/mooncake_manager.py Added Apache 2.0 license header
transfer_queue/storage/clients/ray_storage_client.py Added Apache 2.0 license header
transfer_queue/storage/clients/mooncake_client.py Added Apache 2.0 license header
tests/test_ray_p2p.py Added Apache 2.0 license header
scripts/put_benchmark.py Added Apache 2.0 license header
scripts/performance_test.py Added Apache 2.0 license header

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/sanity/check_license.py
Comment thread .github/workflows/dco-check.yml Outdated
Comment thread tests/sanity/check_docstrings.py
Comment thread .github/workflows/sanity.yml Outdated
Comment thread tests/sanity/check_license.py
Comment thread tests/sanity/check_license.py
Comment thread tests/sanity/check_docstrings.py Outdated
on:
pull_request:
types: [opened, synchronize, reopened]

Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow is missing a permissions section. Following security best practices, GitHub Actions workflows should explicitly define permissions. Consider adding a permissions section that specifies only the minimum required permissions. For this DCO check workflow, you likely need "pull-requests: read" and "contents: read".

Suggested change
permissions:
pull-requests: read
contents: read

Copilot uses AI. Check for mistakes.
Comment thread tests/sanity/check_docstrings.py
Comment thread .github/workflows/sanity.yml Outdated
Signed-off-by: 0oshowero0 <o0shower0o@outlook.com>
Signed-off-by: 0oshowero0 <o0shower0o@outlook.com>
Signed-off-by: 0oshowero0 <o0shower0o@outlook.com>
Signed-off-by: 0oshowero0 <o0shower0o@outlook.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread transfer_queue/utils/utils.py Outdated
Comment thread transfer_queue/utils/zmq_utils.py Outdated
Comment thread transfer_queue/utils/utils.py Outdated
Comment thread transfer_queue/utils/zmq_utils.py
Comment thread tests/sanity/check_license.py
Comment thread .github/workflows/sanity.yml Outdated
Comment thread transfer_queue/storage/clients/mooncake_client.py Outdated
Comment thread tests/sanity/check_license.py Outdated
Comment thread .github/workflows/sanity.yml Outdated
Comment thread tests/sanity/check_license.py
Signed-off-by: 0oshowero0 <o0shower0o@outlook.com>
@0oshowero0 0oshowero0 merged commit 214a4d6 into Ascend:main Jan 25, 2026
4 checks passed
mpb159753 added a commit to mpb159753/TransferQueue that referenced this pull request Mar 5, 2026
Round 1 (Copilot Ascend#5, Ascend#9, Ascend#10, Ascend#17, Ascend#20):
- fix(serial_utils): preserve scalar shape in round-trip serialization
- fix(zmq_utils): add strict=True to zip calls
- fix(metadata): use warnings.warn for parse_dtype fallback
- refactor(metadata): remove dead _convert_legacy_sample_meta code
- fix(simple_backend): downgrade storage unit log to DEBUG

Round 2 (Copilot Ascend#24, 0oshowero0 Ascend#27, Ascend#28):
- perf(simple_backend): track active keys with _active_keys set for O(1)
  capacity check, replacing O(K×F) existing_keys scan in put_data
- docs(tutorial): merge demonstrate_batch_meta_construction() and
  demonstrate_batch_meta() into demonstrate_batch_meta_operations(),
  eliminating 3 duplicate demos and fixing misleading function name

Signed-off-by: 看我72遍 <m.pb@msn.com>
@0oshowero0 0oshowero0 deleted the sanity branch March 20, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants