Skip to content

fix: sync common package version during builds - #416

Open
quseijuro-design wants to merge 2 commits into
oracle:mainfrom
quseijuro-design:fix/413-sync-common-version
Open

fix: sync common package version during builds#416
quseijuro-design wants to merge 2 commits into
oracle:mainfrom
quseijuro-design:fix/413-sync-common-version

Conversation

@quseijuro-design

Copy link
Copy Markdown

Summary

Closes #413.

oracle_mcp_common.__version__ was stale because only server packages had
their runtime version metadata rewritten during builds. This updates the common
package from its pyproject.toml version before local builds and CI builds.

Changes

  • add a shared sync/check script that replaces exactly one common-package
    __version__ declaration and preserves imports and __all__;
  • run the script from make build-common and the build workflow;
  • fail clearly for missing, ambiguous, or drifted version metadata;
  • add regression coverage and a changelog entry.

Validation

  • uv tool run ruff check
  • uv run --no-sync --directory src/common pytest -q --basetemp .pytest-tmp
    (50 passed)
  • uv build --clear in src/common
  • python scripts/sync_common_version.py --check src/common

Signed-off-by: mkt <quseijuro@gmail.com>
@oracle-contributor-agreement

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Aug 14, 2026
@quseijuro-design
quseijuro-design marked this pull request as ready for review August 14, 2026 02:27
@dustin-sale

Copy link
Copy Markdown
Contributor

@quseijuro-design I am wondering if instead of a script this can all be handled in the Makefile?

My original investigation had something like this in _build before the existing oracle/*_mcp_server branch:

			if [ -f "$$dir/oracle_mcp_common/__init__.py" ]; then \
				init_py_file="$$dir/oracle_mcp_common/__init__.py"; \
				python3 -c 'from pathlib import Path; import re, sys; p = Path(sys.argv[1]); text = p.read_text(); text, count = re.subn(r"^__version__ = \".*\"$$", f"__version__ = \"{sys.argv[2]}\"", text, flags=re.MULTILINE); assert count == 1, f"Expected exactly one __version__ in {p}, found {count}"; p.write_text(text)' "$$init_py_file" "$$version"; \
			elif [ -d "$$dir/oracle/"*"_mcp_server" ]; then \
				init_py_file=$$(echo $$dir/oracle/*_mcp_server/__init__.py); \
				printf '...existing server initializer content...' > "$$init_py_file"; \
				echo "__project__ = \"$$name\"" >> "$$init_py_file"; \
				echo "__version__ = \"$$version\"" >> "$$init_py_file"; \
			fi; \

Also, are you able to sign the OCA agreement?

Signed-off-by: mkt <quseijuro@gmail.com>
@quseijuro-design

Copy link
Copy Markdown
Author

Thanks for the suggestion. I agree. I’ll revise the change so the common-package version rewrite lives in _build, immediately before the existing server branch, and the CI build uses the same Makefile path rather than duplicating the logic.

I have submitted the OCA, and it is currently under Oracle review. Once it is approved, I’ll update the branch accordingly. Does that match your intent?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Required At least one contributor does not have an approved Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix build-time version synchronization for oracle-mcp-common

2 participants