From fd7404b1c0832cf283900db0499033cf4c1f275a Mon Sep 17 00:00:00 2001 From: csbobby Date: Tue, 10 Feb 2026 15:26:23 +0000 Subject: [PATCH 1/7] Keep origin workflows; sync main from m_M --- .github/workflows/cd.yml | 12 +----------- .github/workflows/ci.yml | 1 - .github/workflows/quality.yml | 19 +++++++++++-------- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index a4389b0d3..a2d45ad1c 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -2,12 +2,6 @@ name: "Run CD" on: workflow_dispatch: - inputs: - force_release: - description: 'Force release even if previous checks fail.' - type: boolean - required: false - default: false env: UV_FROZEN: "1" @@ -42,11 +36,7 @@ jobs: run: uv run --no-sync semantic-release changelog --unreleased release: needs: [code-checks, pre-release-check] - # Run this job only if the `TARGET_TAG_V` is set AND (the previous jobs - # were successful OR we are forcing the release). - if: >- - ${{ needs.pre-release-check.outputs.TARGET_TAG_V != '' && - ( success() || inputs.force_release ) }} + if: needs.pre-release-check.outputs.TARGET_TAG_V != '' environment: auto-release runs-on: ubuntu-latest concurrency: release diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4fb08f319..825ebbd0f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,6 @@ name: "Run CI" on: pull_request: types: [opened, reopened, synchronize] - merge_group: jobs: code-checks: diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index ad82d084f..757772600 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -3,9 +3,10 @@ name: Verify Code Quality on: workflow_call: + concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref_name }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref_name }} + cancel-in-progress: true env: CICD: 1 @@ -14,10 +15,10 @@ env: jobs: quality: runs-on: ubuntu-latest - timeout-minutes: 90 # TODO: need to reduce this after we figure out our testing strategy. + timeout-minutes: 90 # TODO: need to reduce this after we figure out our testing strategy. strategy: matrix: - python-version: ["3.10", "3.11", "3.12"] # Need to add 3.13 once we resolve outlines issues. + python-version: ['3.10', '3.11', '3.12'] # Need to add 3.13 once we resolve outlines issues. steps: - uses: actions/checkout@v4 - name: Free disk space @@ -38,16 +39,18 @@ jobs: - name: Check style and run tests run: pre-commit run --all-files - name: Send failure message pre-commit - if: failure() # This step will only run if a previous step failed + if: failure() # This step will only run if a previous step failed run: echo "The quality verification failed. Please run precommit " - name: Install Ollama run: curl -fsSL https://ollama.com/install.sh | sh - name: Start serving ollama run: nohup ollama serve & - - name: Pull model granite4:micro - run: ollama pull granite4:micro + - name: Pull Llama 3.2:1b model + run: ollama pull llama3.2:1b + - name: Run Tests run: uv run -m pytest -v test - name: Send failure message tests - if: failure() # This step will only run if a previous step failed + if: failure() # This step will only run if a previous step failed run: echo "Tests failed. Please verify that tests are working locally." + From ff6eedbc267df143aac5a89362e467f4e7a55100 Mon Sep 17 00:00:00 2001 From: csbobby Date: Tue, 10 Feb 2026 15:32:15 +0000 Subject: [PATCH 2/7] Remove pr-update workflow to avoid workflow scope requirement --- .github/workflows/pr-update.yml | 73 --------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 .github/workflows/pr-update.yml diff --git a/.github/workflows/pr-update.yml b/.github/workflows/pr-update.yml deleted file mode 100644 index 33505a0f4..000000000 --- a/.github/workflows/pr-update.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: PR Bot - -on: - pull_request_target: - types: [opened, edited] - -jobs: - update-pr-body: - runs-on: ubuntu-latest - if: ${{ !contains(github.event.pull_request.body, 'mellea-pr-edited-marker') }} - permissions: - pull-requests: write - contents: read - steps: - - name: Checkout code # Checks out the base branch, not PR branch. - uses: actions/checkout@v4 - - - name: Detect PR type from checkboxes - id: detect-type - env: - PR_BODY: ${{ github.event.pull_request.body }} - run: | - PR_TYPE="" - - # Check for checked boxes (supports [x] and [X]) - if echo "$PR_BODY" | grep -qi '\[x\] Component'; then - PR_TYPE="component" - elif echo "$PR_BODY" | grep -qi '\[x\] Requirement'; then - PR_TYPE="requirement" - elif echo "$PR_BODY" | grep -qi '\[x\] Sampling Strategy'; then - PR_TYPE="sampling" - elif echo "$PR_BODY" | grep -qi '\[x\] Tool'; then - PR_TYPE="tool" - elif echo "$PR_BODY" | grep -qi '\[x\] Misc'; then - PR_TYPE="misc" - fi - - if [ -z "$PR_TYPE" ]; then - echo "::error::No PR type selected. Please check one of of the boxes from the original pr template." - exit 1 - fi - - echo "pr_type=$PR_TYPE" >> "$GITHUB_OUTPUT" - echo "Detected PR type: $PR_TYPE" - - - name: Update PR body with checklist - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_BODY: ${{ github.event.pull_request.body }} - PR_TYPE: ${{ steps.detect-type.outputs.pr_type }} - run: | - TEMPLATE_FILE=".github/PULL_REQUEST_TEMPLATE/${PR_TYPE}.md" - - if [ -f "$TEMPLATE_FILE" ]; then - MARKER="" - TEMPLATE_CONTENT=$(cat "$TEMPLATE_FILE") - - NEW_BODY="${MARKER} - ${TEMPLATE_CONTENT}" - - gh pr edit ${{ github.event.pull_request.number }} --body "$NEW_BODY" - echo "Updated PR body with ${PR_TYPE} checklist" - else - echo "::error::Template file not found: $TEMPLATE_FILE" - echo "Something as gone wrong. Contact a maintainer." - exit 1 - fi - - - name: Comment on PR - uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc - with: - message: | - The PR description has been updated. Please fill out the template for your PR to be reviewed. From fdb9894c3ab656b1e1de4a82494e99e2fcdabe22 Mon Sep 17 00:00:00 2001 From: csbobby Date: Tue, 10 Feb 2026 15:37:39 +0000 Subject: [PATCH 3/7] add: robust constraint_extractor parser --- .../_constraint_extractor.py | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/cli/decompose/prompt_modules/constraint_extractor/_constraint_extractor.py b/cli/decompose/prompt_modules/constraint_extractor/_constraint_extractor.py index 43558cce4..a4c07b02f 100644 --- a/cli/decompose/prompt_modules/constraint_extractor/_constraint_extractor.py +++ b/cli/decompose/prompt_modules/constraint_extractor/_constraint_extractor.py @@ -53,20 +53,27 @@ def _default_parser(generated_str: str) -> list[str]: 'LLM failed to generate correct tags for extraction: ""' ) - # TODO: Maybe replace this logic with a RegEx? - constraint_extractor_str_upper = constraint_extractor_str.upper() - if ( - "N/A" in constraint_extractor_str_upper - or "N / A" in constraint_extractor_str_upper - or "N/ A" in constraint_extractor_str_upper - or "N /A" in constraint_extractor_str_upper - ): + s = constraint_extractor_str.strip() + s_upper = s.upper() + if s_upper in {"N/A", "N / A", "N/ A", "N /A"}: return [] - return [ - line.strip()[2:] if line.strip()[:2] == "- " else line.strip() - for line in constraint_extractor_str.splitlines() - ] + results: list[str] = [] + + for line in s.splitlines(): + line = line.strip() + if not line: + continue + + # remove bullet / numbering + line = re.sub(r"^\s*(?:[-*•]|\d+[\.\)])\s+", "", line) + + # split inline multi-constraints + parts = re.split(r"\s*(?:;|\s-\s|\s—\s|\s–\s)\s*", line) + + results.extend(p.strip() for p in parts if p.strip()) + + return results def generate( # type: ignore[override] # About the mypy ignore above: @@ -133,4 +140,4 @@ def generate( # type: ignore[override] return PromptModuleString(gen_result, parser) -constraint_extractor = _ConstraintExtractor() +constraint_extractor = _ConstraintExtractor() \ No newline at end of file From 39a2f923c5711e78ff15071dcd3667efc9e12649 Mon Sep 17 00:00:00 2001 From: csbobby Date: Tue, 10 Feb 2026 16:07:10 +0000 Subject: [PATCH 4/7] upd: sync the workflows with the mellea main --- .github/workflows/cd.yml | 14 ++++++- .github/workflows/ci.yml | 3 +- .github/workflows/pr-update.yml | 73 +++++++++++++++++++++++++++++++++ .github/workflows/quality.yml | 21 ++++------ 4 files changed, 96 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/pr-update.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index a2d45ad1c..5b1973f7f 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -2,6 +2,12 @@ name: "Run CD" on: workflow_dispatch: + inputs: + force_release: + description: 'Force release even if previous checks fail.' + type: boolean + required: false + default: false env: UV_FROZEN: "1" @@ -36,7 +42,11 @@ jobs: run: uv run --no-sync semantic-release changelog --unreleased release: needs: [code-checks, pre-release-check] - if: needs.pre-release-check.outputs.TARGET_TAG_V != '' + # Run this job only if the `TARGET_TAG_V` is set AND (the previous jobs + # were successful OR we are forcing the release). + if: >- + ${{ needs.pre-release-check.outputs.TARGET_TAG_V != '' && + ( success() || inputs.force_release ) }} environment: auto-release runs-on: ubuntu-latest concurrency: release @@ -63,4 +73,4 @@ jobs: CHGLOG_FILE: CHANGELOG.md GITHUB_REPOSITORY: ${{ github.repository }} run: ./.github/scripts/release.sh - shell: bash + shell: bash \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 825ebbd0f..ad19aa03e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,8 @@ name: "Run CI" on: pull_request: types: [opened, reopened, synchronize] + merge_group: jobs: code-checks: - uses: ./.github/workflows/quality.yml + uses: ./.github/workflows/quality.yml \ No newline at end of file diff --git a/.github/workflows/pr-update.yml b/.github/workflows/pr-update.yml new file mode 100644 index 000000000..f99964e24 --- /dev/null +++ b/.github/workflows/pr-update.yml @@ -0,0 +1,73 @@ +name: PR Bot + +on: + pull_request_target: + types: [opened, edited] + +jobs: + update-pr-body: + runs-on: ubuntu-latest + if: ${{ !contains(github.event.pull_request.body, 'mellea-pr-edited-marker') }} + permissions: + pull-requests: write + contents: read + steps: + - name: Checkout code # Checks out the base branch, not PR branch. + uses: actions/checkout@v4 + + - name: Detect PR type from checkboxes + id: detect-type + env: + PR_BODY: ${{ github.event.pull_request.body }} + run: | + PR_TYPE="" + + # Check for checked boxes (supports [x] and [X]) + if echo "$PR_BODY" | grep -qi '\[x\] Component'; then + PR_TYPE="component" + elif echo "$PR_BODY" | grep -qi '\[x\] Requirement'; then + PR_TYPE="requirement" + elif echo "$PR_BODY" | grep -qi '\[x\] Sampling Strategy'; then + PR_TYPE="sampling" + elif echo "$PR_BODY" | grep -qi '\[x\] Tool'; then + PR_TYPE="tool" + elif echo "$PR_BODY" | grep -qi '\[x\] Misc'; then + PR_TYPE="misc" + fi + + if [ -z "$PR_TYPE" ]; then + echo "::error::No PR type selected. Please check one of of the boxes from the original pr template." + exit 1 + fi + + echo "pr_type=$PR_TYPE" >> "$GITHUB_OUTPUT" + echo "Detected PR type: $PR_TYPE" + + - name: Update PR body with checklist + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_BODY: ${{ github.event.pull_request.body }} + PR_TYPE: ${{ steps.detect-type.outputs.pr_type }} + run: | + TEMPLATE_FILE=".github/PULL_REQUEST_TEMPLATE/${PR_TYPE}.md" + + if [ -f "$TEMPLATE_FILE" ]; then + MARKER="" + TEMPLATE_CONTENT=$(cat "$TEMPLATE_FILE") + + NEW_BODY="${MARKER} + ${TEMPLATE_CONTENT}" + + gh pr edit ${{ github.event.pull_request.number }} --body "$NEW_BODY" + echo "Updated PR body with ${PR_TYPE} checklist" + else + echo "::error::Template file not found: $TEMPLATE_FILE" + echo "Something as gone wrong. Contact a maintainer." + exit 1 + fi + + - name: Comment on PR + uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc + with: + message: | + The PR description has been updated. Please fill out the template for your PR to be reviewed. \ No newline at end of file diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 757772600..4bb927b0a 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -3,10 +3,9 @@ name: Verify Code Quality on: workflow_call: - concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref_name }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref_name }} + cancel-in-progress: true env: CICD: 1 @@ -15,10 +14,10 @@ env: jobs: quality: runs-on: ubuntu-latest - timeout-minutes: 90 # TODO: need to reduce this after we figure out our testing strategy. + timeout-minutes: 90 # TODO: need to reduce this after we figure out our testing strategy. strategy: matrix: - python-version: ['3.10', '3.11', '3.12'] # Need to add 3.13 once we resolve outlines issues. + python-version: ["3.10", "3.11", "3.12"] # Need to add 3.13 once we resolve outlines issues. steps: - uses: actions/checkout@v4 - name: Free disk space @@ -39,18 +38,16 @@ jobs: - name: Check style and run tests run: pre-commit run --all-files - name: Send failure message pre-commit - if: failure() # This step will only run if a previous step failed + if: failure() # This step will only run if a previous step failed run: echo "The quality verification failed. Please run precommit " - name: Install Ollama run: curl -fsSL https://ollama.com/install.sh | sh - name: Start serving ollama run: nohup ollama serve & - - name: Pull Llama 3.2:1b model - run: ollama pull llama3.2:1b - + - name: Pull model granite4:micro + run: ollama pull granite4:micro - name: Run Tests run: uv run -m pytest -v test - name: Send failure message tests - if: failure() # This step will only run if a previous step failed - run: echo "Tests failed. Please verify that tests are working locally." - + if: failure() # This step will only run if a previous step failed + run: echo "Tests failed. Please verify that tests are working locally." \ No newline at end of file From 72e547023b86787727a72945897c660193aa674c Mon Sep 17 00:00:00 2001 From: csbobby Date: Tue, 10 Feb 2026 20:16:57 +0000 Subject: [PATCH 5/7] upd: add the newlines in the workflows files --- .github/workflows/cd.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/pr-update.yml | 2 +- .github/workflows/quality.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 5b1973f7f..a4389b0d3 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -73,4 +73,4 @@ jobs: CHGLOG_FILE: CHANGELOG.md GITHUB_REPOSITORY: ${{ github.repository }} run: ./.github/scripts/release.sh - shell: bash \ No newline at end of file + shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad19aa03e..4fb08f319 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,4 +7,4 @@ on: jobs: code-checks: - uses: ./.github/workflows/quality.yml \ No newline at end of file + uses: ./.github/workflows/quality.yml diff --git a/.github/workflows/pr-update.yml b/.github/workflows/pr-update.yml index f99964e24..33505a0f4 100644 --- a/.github/workflows/pr-update.yml +++ b/.github/workflows/pr-update.yml @@ -70,4 +70,4 @@ jobs: uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc with: message: | - The PR description has been updated. Please fill out the template for your PR to be reviewed. \ No newline at end of file + The PR description has been updated. Please fill out the template for your PR to be reviewed. diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 4bb927b0a..ad82d084f 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -50,4 +50,4 @@ jobs: run: uv run -m pytest -v test - name: Send failure message tests if: failure() # This step will only run if a previous step failed - run: echo "Tests failed. Please verify that tests are working locally." \ No newline at end of file + run: echo "Tests failed. Please verify that tests are working locally." From c6862403f63728f35d4cc2aa08e4ead07f95022e Mon Sep 17 00:00:00 2001 From: csbobby Date: Tue, 10 Feb 2026 20:17:58 +0000 Subject: [PATCH 6/7] upd: normalizing whitespace and separators for the constraint NA situations --- .../constraint_extractor/_constraint_extractor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/decompose/prompt_modules/constraint_extractor/_constraint_extractor.py b/cli/decompose/prompt_modules/constraint_extractor/_constraint_extractor.py index a4c07b02f..c86a569e3 100644 --- a/cli/decompose/prompt_modules/constraint_extractor/_constraint_extractor.py +++ b/cli/decompose/prompt_modules/constraint_extractor/_constraint_extractor.py @@ -54,8 +54,8 @@ def _default_parser(generated_str: str) -> list[str]: ) s = constraint_extractor_str.strip() - s_upper = s.upper() - if s_upper in {"N/A", "N / A", "N/ A", "N /A"}: + s_norm = s.strip().upper().replace(" ", "") + if s_norm == "N/A": return [] results: list[str] = [] From d2e07d57f3ab2749baac61f40d0a6638c9538cab Mon Sep 17 00:00:00 2001 From: csbobby Date: Thu, 12 Feb 2026 16:34:47 +0000 Subject: [PATCH 7/7] upd: format with a newline --- .../constraint_extractor/_constraint_extractor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/decompose/prompt_modules/constraint_extractor/_constraint_extractor.py b/cli/decompose/prompt_modules/constraint_extractor/_constraint_extractor.py index c86a569e3..8e7d9bd2f 100644 --- a/cli/decompose/prompt_modules/constraint_extractor/_constraint_extractor.py +++ b/cli/decompose/prompt_modules/constraint_extractor/_constraint_extractor.py @@ -140,4 +140,4 @@ def generate( # type: ignore[override] return PromptModuleString(gen_result, parser) -constraint_extractor = _ConstraintExtractor() \ No newline at end of file +constraint_extractor = _ConstraintExtractor()