Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 15 additions & 104 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,120 +9,31 @@ on:
permissions:
contents: read
jobs:
build:
name: Python / ${{ matrix.directory }}
ci:
name: CI
runs-on: ubuntu-latest
needs: get-directories
strategy:
matrix:
directory: ${{ fromJson(needs.get-directories.outputs.directories) }}
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: "3.13"

- name: Install requirements
run: pip install -r requirements-dev.txt

- name: Sync
working-directory: src/${{ matrix.directory }}
run: uv sync --locked --all-extras --dev

- name: Test and Coverage
working-directory: src/${{ matrix.directory }}
run: uv run pytest --cov=. --cov-branch --cov-report=html:htmlcov/${{ matrix.directory }} --cov-report=term-missing
env:
COVERAGE_FILE: .coverage.${{ matrix.directory }}

- name: Build
working-directory: src/${{ matrix.directory }}
run: uv build

- name: Test install
working-directory: src/${{ matrix.directory }}
run: uv pip install .

- name: Upload coverage report
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ${{ matrix.directory }}-coverage-report
path: |
src/${{ matrix.directory }}/htmlcov/*
src/${{ matrix.directory }}/.coverage.${{ matrix.directory }}
include-hidden-files: true

get-directories:
runs-on: ubuntu-latest
outputs:
directories: ${{ steps.get-directories.outputs.directories }}
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- name: Get Python package directories
id: get-directories
run: |
directories=$(ls src | grep -v dbtools-mcp-server | grep -v mysql-mcp-server | grep -v oci-javascript-mcp-server | grep -v oci-pricing-mcp-server | grep -v oracle-db-doc-mcp-server | grep -v oracle-db-mcp-java-toolkit | jq -R -s -c 'split("\n")[:-1]')
echo "directories=$directories" >> $GITHUB_OUTPUT

combined-coverage:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: "3.13"

- name: Install requirements
run: pip install -r requirements-dev.txt
fetch-depth: 0

- name: Download Artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
pattern: '*-coverage-report' # Downloads all artifacts starting with 'my-artifact-'
merge-multiple: true # Merges the contents of multiple artifacts into a single directory

- name: Combine Coverage reports
- name: Run Moon CI
run: |
make combine-coverage

- name: Upload combined reports
moon_version=$(sed -n 's/^moon = "=\([0-9][0-9.]*\)"$/\1/p' .prototools)
test -n "$moon_version"
npx --yes --ignore-scripts --package="@moonrepo/cli@$moon_version" -- \
moon run root:lint :lock-check :install-check \
oci-javascript-mcp-server:ci
npx --yes --ignore-scripts --package="@moonrepo/cli@$moon_version" -- \
moon run root:combine-coverage

- name: Upload combined coverage report
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: all-in-one-coverage-report
path: |
oracle-mcp-coverage-report/*
htmlcov/**/*
src/*/htmlcov/**/*
.coverage
include-hidden-files: true

javascript-build:
name: JavaScript / ${{ matrix.directory }}
runs-on: ubuntu-latest
strategy:
matrix:
directory:
- oci-javascript-mcp-server
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- name: Set up Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "26"

- name: Install dependencies
working-directory: src/${{ matrix.directory }}
run: npm ci

- name: Test and Check
working-directory: src/${{ matrix.directory }}
run: npm run ci
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ venv.bak/
# Python uv
.python-version

# moon
.moon/cache/

# VScode
.vscode

Expand Down
75 changes: 75 additions & 0 deletions .moon/tasks/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
inheritedBy:
file: 'pyproject.toml'

fileGroups:
sources:
- 'oracle/**/*'
- 'oracle_mcp_common/**/*'
- '!oracle/**/tests/**/*'
- '!oracle_mcp_common/tests/**/*'
tests:
- 'oracle/**/tests/**/*'
- 'oracle_mcp_common/tests/**/*'
- 'tests/**/*'
buildFiles:
- '**/*'
- '!.coverage*'
- '!dist/**/*'
- '!htmlcov/**/*'

tasks:
lock-check:
description: 'Verifies that uv.lock is current'
command: 'uv lock --check'
inputs:
- 'pyproject.toml'
- 'uv.lock'
- project: '^'
filter:
- 'pyproject.toml'

test:
description: 'Runs unit tests with branch coverage'
type: 'test'
command:
- 'uv'
- 'run'
- 'pytest'
- '--cov=.'
- '--cov-branch'
- '--cov-report=html'
- '--cov-report=term-missing'
env:
COVERAGE_FILE: '$workspaceRoot/.coverage.$project'
inputs:
- '@group(sources)'
- '@group(tests)'
- 'pyproject.toml'
- 'uv.lock'
- project: '^'
filter:
- 'oracle/**/*'
- '!oracle/**/tests/**/*'
- 'oracle_mcp_common/**/*'
- '!oracle_mcp_common/tests/**/*'
- 'pyproject.toml'
outputs:
- '/.coverage.$project'
- 'htmlcov/**/*'

build:
description: 'Builds wheel and source distributions'
command: 'uv build --clear'
inputs:
- '@group(buildFiles)'
outputs:
- 'dist/**/*'

install-check:
description: 'Verifies that the project can be installed'
command: 'uv pip install .'
deps:
- target: 'test'
- target: 'build'
options:
cache: false
19 changes: 19 additions & 0 deletions .moon/toolchains.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
javascript:
packageManager: 'npm'
inferTasksFromScripts: true

node: {}

npm: {}

unstable_python:
packageManager: 'uv'

unstable_uv:
syncArgs:
- '--locked'
- '--all-extras'
- '--dev'
- '--no-managed-python'
- '--no-python-downloads'
- '--no-progress'
13 changes: 13 additions & 0 deletions .moon/workspace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
projects:
globs:
- 'moon.yml'
- 'src/*/package.json'
- 'src/*/pyproject.toml'
- '!src/dbtools-mcp-server/pyproject.toml'
- '!src/mysql-mcp-server/pyproject.toml'
- '!src/oci-pricing-mcp-server/pyproject.toml'
- '!src/oracle-db-doc-mcp-server/pyproject.toml'
- '!src/oracle-db-mcp-java-toolkit/pyproject.toml'

vcs:
defaultBranch: 'main'
5 changes: 5 additions & 0 deletions .prototools
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
moon = "=2.5.2"
node = "=26.8.1"
npm = "=11.12.1"
python = "=3.13.15"
uv = "=0.12.1"
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ javascript-ci:
ci: lint test javascript-ci

combine-coverage:
uv run coverage combine
uv run coverage html
uv run coverage report --fail-under=90
uv tool run coverage combine
uv tool run coverage html
uv tool run coverage report --fail-under=90

publish:
@$(MAKE) publish-common PUBLISH_URL="$(PYPI_PUBLISH_URL)" PUBLISH_CHECK_URL="$(PYPI_CHECK_URL)"
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,28 @@ To run both the Python and JavaScript checks from the repository root:
make ci
```

### Running tasks with moon

The standard Python server projects and the JavaScript MCP server can also be
orchestrated with [moon](https://moonrepo.dev/). Tool versions are pinned in
`.prototools`; after installing [proto](https://moonrepo.dev/docs/proto/install),
install the pinned tools and run tasks from the repository root:

```bash
proto install
moon run oci-compute-mcp-server:test
moon run oci-javascript-mcp-server:ci
moon run :lint
moon run :build
```

Moon uses each project's language-specific package definition: `pyproject.toml`
and `uv.lock` for Python, and `package.json` and `package-lock.json` for
JavaScript. The JavaScript tasks are inferred from the existing npm scripts.
Other projects excluded from the repository-level Make targets are not part of
this Moon rollout and continue to use the validation commands in their own
README.

## Publishing

### Publish & verify test packages
Expand Down
43 changes: 43 additions & 0 deletions moon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
id: 'root'

fileGroups:
pythonSources:
- '**/*.py'

tasks:
lint:
description: 'Checks repository Python source with Ruff'
command: 'uv tool run ruff check .'
toolchains:
- 'unstable_python'
- 'unstable_uv'
inputs:
- '@group(pythonSources)'
- 'ruff.toml'
- 'requirements-dev.txt'

format:
description: 'Formats repository Python source with Ruff'
command: 'uv tool run ruff format .'
toolchains:
- 'unstable_python'
- 'unstable_uv'
inputs:
- '@group(pythonSources)'
- 'ruff.toml'
- 'requirements-dev.txt'
preset: 'utility'

combine-coverage:
description: 'Combines project coverage reports'
command: 'make combine-coverage'
toolchains:
- 'unstable_python'
- 'unstable_uv'
inputs:
- '.coverage.*'
outputs:
- '.coverage'
- 'htmlcov/**/*'
options:
cache: false
1 change: 1 addition & 0 deletions src/common/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ exclude = [
"/dist/**",
"/build/**",
"/uv.lock",
"/moon.yml",
"**/__pycache__/**",
"**/*.py[cod]",
"/.DS_Store",
Expand Down
1 change: 1 addition & 0 deletions src/mysql-mcp-server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ exclude = [
"/dist/**",
"/build/**",
"/uv.lock",
"/moon.yml",
"**/__pycache__/**",
"**/*.py[cod]",
"/.DS_Store",
Expand Down
2 changes: 2 additions & 0 deletions src/oci-api-mcp-server/moon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dependsOn:
- 'common'
1 change: 1 addition & 0 deletions src/oci-api-mcp-server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ exclude = [
"/dist/**",
"/build/**",
"/uv.lock",
"/moon.yml",
"**/__pycache__/**",
"**/*.py[cod]",
"/.DS_Store",
Expand Down
1 change: 1 addition & 0 deletions src/oci-cloud-guard-mcp-server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ exclude = [
"/dist/**",
"/build/**",
"/uv.lock",
"/moon.yml",
"**/__pycache__/**",
"**/*.py[cod]",
"/.DS_Store",
Expand Down
2 changes: 2 additions & 0 deletions src/oci-cloud-mcp-server/moon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dependsOn:
- 'common'

@gebhardtr gebhardtr Aug 21, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

required until moon can handle version ranges, like the following, properly in the project dependencies:

oracle-mcp-common>=0.1.2,<0.2.0

1 change: 1 addition & 0 deletions src/oci-cloud-mcp-server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ exclude = [
"/dist/**",
"/build/**",
"/uv.lock",
"/moon.yml",
"**/__pycache__/**",
"**/*.py[cod]",
"/.DS_Store",
Expand Down
Loading
Loading