Skip to content

Refactor generate-wiki-docs.py to derive config from project files instead of hardcoding#265

Merged
mercyblitz merged 3 commits intomainfrom
copilot/refactor-generate-wiki-docs-script
Mar 24, 2026
Merged

Refactor generate-wiki-docs.py to derive config from project files instead of hardcoding#265
mercyblitz merged 3 commits intomainfrom
copilot/refactor-generate-wiki-docs-script

Conversation

Copy link
Contributor

Copilot AI commented Mar 24, 2026

All key configuration values in the wiki generator script were hardcoded and out of sync with the project (e.g. PROJECT_VERSION was 0.1.10-SNAPSHOT, actual is 0.2.1-SNAPSHOT). Refactored to read them dynamically from source-of-truth files.

Dynamic config readers

  • MODULES — discovered via filesystem by listing subdirs containing src/main/java, replacing a hardcoded 6-element list
  • JAVA_VERSIONS — parsed from matrix.java in .github/workflows/maven-build.yml
  • PROJECT_VERSION — parsed from <revision> property in root pom.xml
  • ARTIFACT_ID (new) — parsed from root pom.xml, replaces all hardcoded "microsphere-java" in URLs, Maven snippets, and generated text
  • PROJECT_TITLE (new) — parsed from # heading in README.md, replaces all hardcoded "Microsphere Java" in generated pages
MODULES = _discover_modules(PROJECT_ROOT)
JAVA_VERSIONS = _read_java_versions(PROJECT_ROOT)
PROJECT_VERSION = _read_pom_revision(PROJECT_ROOT)
ARTIFACT_ID = _read_pom_artifact_id(PROJECT_ROOT)
PROJECT_TITLE = _read_readme_title(PROJECT_ROOT)

Each reader emits a warning to stderr if parsing fails. No new dependencies — all parsing uses re and os from stdlib.

Housekeeping

  • Added __pycache__/ to .gitignore

Copilot AI and others added 3 commits March 24, 2026 08:27
… config reads

- MODULES: dynamically discovered via filesystem (subdirs with src/main/java)
- JAVA_VERSIONS: parsed from .github/workflows/maven-build.yml matrix.java
- PROJECT_VERSION: parsed from root pom.xml revision property
- ARTIFACT_ID: parsed from root pom.xml artifactId (replaces hardcoded "microsphere-java")
- PROJECT_TITLE: parsed from README.md title (replaces hardcoded "Microsphere Java")

Co-authored-by: mercyblitz <533114+mercyblitz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsphere-projects/microsphere-java/sessions/67ece2a6-fae8-47b1-b76a-903ba01b4dbb
@sonarqubecloud
Copy link

@mercyblitz mercyblitz marked this pull request as ready for review March 24, 2026 08:47
@mercyblitz mercyblitz merged commit a7fc3cc into main Mar 24, 2026
6 checks passed
@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mercyblitz mercyblitz deleted the copilot/refactor-generate-wiki-docs-script branch March 24, 2026 10:29
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