Skip to content

feat: add dynamic rules update mechanism to decouple rules from packa…#34

Open
xiao201208 wants to merge 1 commit intoaliyun:mainfrom
xiao201208:feature/decoupling_rules
Open

feat: add dynamic rules update mechanism to decouple rules from packa…#34
xiao201208 wants to merge 1 commit intoaliyun:mainfrom
xiao201208:feature/decoupling_rules

Conversation

@xiao201208
Copy link
Collaborator

[…ge releases](feat: add dynamic rules update mechanism to decouple rules from package releases)

Allow users to update transform rules without upgrading the package by pulling the latest rules directly from the GitHub repository.

Core changes:

  • Add rostran/core/rules_updater.py: downloads rules from GitHub, caches them at ~/.rostran/rules/, and manages semantic versioning via rostran/rules/VERSION and VERSIONS.json (version-to-commit mapping).
  • Modify RuleManager.load() to support dual-source loading: user-level cache takes precedence over built-in rules shipped with the package.
  • Add CLI commands:
    • rostran update-rules with --version, --list, --force, --clean
    • rostran rules-version to show active rules source and version
  • Move tools/tf_ali_ros_generate_mappings.json into rostran/rules/ so it is included in dynamic rules updates.

CI automation:

  • Add auto_rules_version.yml: when rule files change on push/PR to main, automatically bump the patch version in VERSION and record the new version with commit SHA in VERSIONS.json.
  • Add auto_version_bump.yml: when non-rules code changes on push/PR to main, automatically bump the patch version in rostran/init.py.
  • Both workflows include loop-prevention guards.

Also:

  • Add English and Chinese documentation for the new commands in docs/.
  • Add 18 unit tests covering the updater, version management, and RuleManager fallback behavior.

Made-with: Cursor

…ge releases

Allow users to update transform rules without upgrading the package by
pulling the latest rules directly from the GitHub repository.

Core changes:
- Add rostran/core/rules_updater.py: downloads rules from GitHub,
  caches them at ~/.rostran/rules/, and manages semantic versioning
  via rostran/rules/VERSION and VERSIONS.json (version-to-commit mapping).
- Modify RuleManager.load() to support dual-source loading: user-level
  cache takes precedence over built-in rules shipped with the package.
- Add CLI commands:
  - `rostran update-rules` with --version, --list, --force, --clean
  - `rostran rules-version` to show active rules source and version
- Move tools/tf_ali_ros_generate_mappings.json into rostran/rules/ so
  it is included in dynamic rules updates.

CI automation:
- Add auto_rules_version.yml: when rule files change on push/PR to main,
  automatically bump the patch version in VERSION and record the new
  version with commit SHA in VERSIONS.json.
- Add auto_version_bump.yml: when non-rules code changes on push/PR to
  main, automatically bump the patch version in rostran/__init__.py.
- Both workflows include loop-prevention guards.

Also:
- Add English and Chinese documentation for the new commands in docs/.
- Add 18 unit tests covering the updater, version management, and
  RuleManager fallback behavior.

Made-with: Cursor
@xiao201208 xiao201208 requested a review from Prodesire March 20, 2026 07:53
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.

1 participant