feat: restructure repository#40
feat: restructure repository#40akihikokuroda wants to merge 49 commits intogenerative-computing:mainfrom
Conversation
jakelorocco
left a comment
There was a problem hiding this comment.
Is it possible to make the workflows dynamic? Ie instead of having to create a new one for each subpackage, we just mandate all folders under mellea_contribs are subpackages and require some sort of structure?
Even if we don't have that, we should make sure to have a version of the quality check that ensures new packages have tests. For example, if I make a new subpackage and don't add tests / quality workflows right now, will I be able to merge? Or there's some necessary check still?
I'm also not certain how these differently named checks interact with github branch protections? For the mellea repo, we have to specifically select checks.
|
@jakelorocco A new CI that checks if each subpackage has its own ci can be added. The quality of each ci is up-to the subpackage though. Is it enough as a minimum? |
I think that makes sense. We should vet CI at merge time, but a check will ensure nothing gets through accidentally. |
|
Once this merges, we'll also need to update the required checks in the branch protections ( as the quality checks no longer exist) |
.github/workflows/ci.yml
Outdated
| on: | ||
| pull_request: | ||
| types: [opened, reopened, synchronize] | ||
| workflow_dispatch: |
There was a problem hiding this comment.
this would need to be run manually right? would this be more for auditing or do you see another purpose?
There was a problem hiding this comment.
Yes, this must be run manually. I just left it for convenience. It can be deleted.
There was a problem hiding this comment.
So we can't have checks on this repo then? Or the checks just need to be manually kicked off for a given branch / PR?
There was a problem hiding this comment.
I also don't know how branch protections interact with this. And also, if this is the case, why are the github action runners showing that checks ran below in the PR?
| push: | ||
| branches: | ||
| - main | ||
| paths: |
There was a problem hiding this comment.
since all the backends depend on mellea-integration-core, there is the chance that if we change something in the core that it would break the backends... should we also trigger a run of the backends if the core changes?
There was a problem hiding this comment.
That's right. I'll add mellea-integration-core change in all integration paths.
There was a problem hiding this comment.
I don't think we should create cross-dependencies in this repo. See my comment below, but if we update mellea-integration-core and it forces us to update other packages, then we've just inherited a ton of maintenance work.
There was a problem hiding this comment.
I took out the cross-dependencies build.
|
|
||
| dependencies = [ | ||
| "mellea>=0.3.2", | ||
| "mellea==0.3.2", |
There was a problem hiding this comment.
do we want to bump this to 0.4.0?
longer-term, we probably need to sync our update strategy here to the release process
cc @jakelorocco
There was a problem hiding this comment.
I only flagged one, but there are multiple places we may need to update if we do want to bump
There was a problem hiding this comment.
Some tests failed with 0.4.0. Bumping 0.4.0 will be follow up PR.
There was a problem hiding this comment.
I think it's fine for these to lag behind mellea (and expected since we don't want to own all the maintenance here). What happens if we bump mellea-integration-core? Do the internal packages that rely on it in here also have to get bumped? If so, that seems untenable.
There was a problem hiding this comment.
Integration projects can pin to a release of mellea-integration-core. The release numbering of the mellea-integration-core needs some rule that related to the compatible Mellea release and API version of the integration-core.
There was a problem hiding this comment.
thinking back on this, I'm wondering if we should revert this change and just set a minimum mellea version rather than pinning to one specifically?
psschwei
left a comment
There was a problem hiding this comment.
I think I am largely good with the changes here. would be good to have a review from the core team as well
jakelorocco
left a comment
There was a problem hiding this comment.
I think this is looking good and on the right track. The main purpose of my comments is to make longterm support from the Mellea team much less burdensome in this repo. To me, that means automating a large amount of the testing process and ensuring subpackages can be updated independently when needed.
run_tests.sh
Outdated
| # Test reqlib_package (may have dependency issues) | ||
| echo "==========================================" | ||
| echo "Testing: reqlib_package" | ||
| echo "==========================================" | ||
| echo -e "${YELLOW}Note: reqlib_package requires additional dependencies (citeurl, eyecite, playwright)${NC}" | ||
| cd "$REPO_ROOT/mellea_contribs/reqlib_package" | ||
| if PYTHONPATH="src:$PYTHONPATH" python3 -m pytest test/ -v --tb=short 2>&1; then | ||
| echo -e "${GREEN}✓ reqlib_package tests PASSED${NC}" | ||
| PASSED_PROJECTS+=("reqlib_package") | ||
| else | ||
| echo -e "${YELLOW}⚠ reqlib_package tests SKIPPED (missing dependencies)${NC}" | ||
| FAILED_PROJECTS+=("reqlib_package (missing deps)") | ||
| fi | ||
| echo "" | ||
|
|
||
| # Test tools_package (may have dependency issues) | ||
| echo "==========================================" | ||
| echo "Testing: tools_package" | ||
| echo "==========================================" | ||
| echo -e "${YELLOW}Note: test_mprogram_robustness.py requires 'benchdrift' package (skipped)${NC}" | ||
| cd "$REPO_ROOT/mellea_contribs/tools_package" | ||
| if PYTHONPATH="src:$PYTHONPATH" python3 -m pytest test/test_double_round_robin.py test/test_top_k.py -v --tb=short 2>&1; then | ||
| echo -e "${GREEN}✓ tools_package tests PASSED (2 tests, test_mprogram_robustness.py skipped - requires benchdrift)${NC}" | ||
| PASSED_PROJECTS+=("tools_package") | ||
| else | ||
| echo -e "${YELLOW}⚠ tools_package tests FAILED${NC}" | ||
| FAILED_PROJECTS+=("tools_package") | ||
| fi | ||
| echo "" |
There was a problem hiding this comment.
We should mandate that all projects have the same structure. We shouldn't need to specify different commands here than from the run_project_tests above.
There was a problem hiding this comment.
Projects have the same structure now. This file was made for convenience. It probably causes confusion and maintenance issue. So I removed it.
|
|
||
| dependencies = [ | ||
| "mellea>=0.3.2", | ||
| "mellea==0.3.2", |
There was a problem hiding this comment.
I think it's fine for these to lag behind mellea (and expected since we don't want to own all the maintenance here). What happens if we bump mellea-integration-core? Do the internal packages that rely on it in here also have to get bumped? If so, that seems untenable.
| push: | ||
| branches: | ||
| - main | ||
| paths: |
There was a problem hiding this comment.
I don't think we should create cross-dependencies in this repo. See my comment below, but if we update mellea-integration-core and it forces us to update other packages, then we've just inherited a ton of maintenance work.
| @@ -0,0 +1 @@ | |||
| README.md | |||
There was a problem hiding this comment.
I think we should either remove the README.md or add something here (even if it's auto generated). There's another README.md with the same problem.
There was a problem hiding this comment.
I took out this file.
There was a problem hiding this comment.
I might have missed it, but does this introduce the auto-detect packages without testing that we talked about?
There was a problem hiding this comment.
This file was left for convenience. It may cause confusion so I removed this file.
.github/workflows/ci.yml
Outdated
| detect-changes: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| mellea-integration-core: ${{ steps.changes.outputs.mellea-integration-core }} | ||
| crewai-backend: ${{ steps.changes.outputs.crewai-backend }} | ||
| dspy-backend: ${{ steps.changes.outputs.dspy-backend }} | ||
| langchain-backend: ${{ steps.changes.outputs.langchain-backend }} | ||
| reqlib-package: ${{ steps.changes.outputs.reqlib-package }} | ||
| tools-package: ${{ steps.changes.outputs.tools-package }} |
There was a problem hiding this comment.
I feel like instead of having to manually add a bunch of boilerplate for any new package that gets added to this repo, we should enforce a required package structure. Then, we don't need to duplicate this code and can just auto-process any new additions and automatically handle new packages in CI runs.
There was a problem hiding this comment.
This file was left for convenience. It may cause confusion so I removed this file.
.github/workflows/ci.yml
Outdated
| on: | ||
| pull_request: | ||
| types: [opened, reopened, synchronize] | ||
| workflow_dispatch: |
There was a problem hiding this comment.
So we can't have checks on this repo then? Or the checks just need to be manually kicked off for a given branch / PR?
|
@jakelorocco I'm taking out ci.yml, README.md and run_test.sh. They are not necessary and may be causing issues later. I also take back the changes mellea_integration_core kicking the 3 integrations ci. |
|
Hi @akihikokuroda, I see that you re-requested my review. Based on the changes since my previous review, I don't think my review comments have been addressed yet. Please let me know if you have questions / disagreements with my suggestions. |
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Add detect-changes job that checks which subpackages have been modified and outputs flags for each. Each subpackage workflow now only runs when: - Its files in mellea_contribs/ are changed, OR - Its corresponding quality workflow file is changed This prevents unnecessary CI runs when only unrelated subpackages are modified. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
0d40973 to
4f21cf4
Compare
|
@jakelorocco I removed the ".github/workflows/ci.yml" that is not unnecessary and may cause confusion. I think I addressed all your comments. Thanks! |
|
Once this PR is merged, I'll work on to make the integrations work with Mellea 0.4.0. |
psschwei
left a comment
There was a problem hiding this comment.
We should also add some documentation on how the repo is now structured (readme, contribution docs).
| strategy: | ||
| matrix: | ||
| python-version: ["3.11", "3.12", "3.13"] | ||
| max-parallel: 1 |
There was a problem hiding this comment.
Is it possible to run these tests in parallel rather than sequentially? (will speed up CI time)
There was a problem hiding this comment.
It is suggested that they may cause conflicts especially LLM access. I'm not sure but I made safe setting.
| cd mellea_contribs/crewai_backend | ||
| if ! command -v uv &> /dev/null; then | ||
| echo "Installing uv..." | ||
| pip install uv |
There was a problem hiding this comment.
the old action used astral-sh/setup-uv@v5 to setup uv... any reason why we're doing that manually now?
There was a problem hiding this comment.
It had some issues with the action. I believe that the reason were integration-core is not published yet and the the it is sub-project in the repo. I would revisit once the core is published.
@psschwei once this is finalized. I'll work on CD and docs. |
jakelorocco
left a comment
There was a problem hiding this comment.
Were you able to investigate how github PR checks would be able to handle having differently named checks? I believe you have to specify each check and I'm not certain there's a way to set selection criteria for which checks are needed.
If there's not a way to do that, that's another reason why I think we should just have one check that runs the relevant tests and have the PR pass status checks based off that.
There was a problem hiding this comment.
All of the ci-.yml and quality-.yml files are almost equivalent. I had previously mentioned if it would be possible to just check that tests exist in a given location and run those tests. Is that possible?
Then, for any subpackage, we can detect changes to that subpackage, and automatically run the tests without having to add boilerplate.
We can just force all tests to be runnable with pytest <subpackage>/tests or something like that.
I don't think we should force all subpackages to update this boilerplate code. If something ever changes in how we want to orchestrate, it will be a much larger change.
| paths: | ||
| - 'mellea_contribs/**' | ||
| - '.github/workflows/ci-*.yml' | ||
| - '.github/workflows/quality-*.yml' | ||
| - '.github/workflows/ci-subpackage-validation.yml' | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'mellea_contribs/**' | ||
| - '.github/workflows/ci-*.yml' | ||
| - '.github/workflows/quality-*.yml' | ||
| - '.github/workflows/ci-subpackage-validation.yml' |
There was a problem hiding this comment.
Have you thought about how we should handle changes to files outside of this set (like pyproject.toml, etc...)? Do changes to those files require testing any of the subpackages?
There was a problem hiding this comment.
This CI is for checking if all of the sub project have its own CI. The CI for the sub project should be triggered any file changes in it. The file changes in the root or directries other than mellea_contribs are not monitored.
Replace 6 package-specific quality workflows with a single reusable generic workflow that auto-discovers tests. This eliminates 240+ lines of duplicated test logic and reduces friction when adding new subpackages. Benefits: - Single source of truth for test execution logic - One file to update when CI requirements change - Automatic test discovery (tests/ or test/ directories) - Consistent behavior across all subpackages - 38% fewer workflow files (13 → 8) All CI wrappers now pass subpackage path and package-specific config (timeout, Ollama requirement) to the generic workflow. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
The CI was trying to run tests for mellea_contribs/tools which was deleted and renamed to mellea_contribs/tools_package. Added --diff-filter=ACMRTU to git diff to exclude deleted files from the discovery process, preventing the CI from trying to test non-existent directories. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
|
@jakelorocco @psschwei The ci.yml and quality_generic.yml files updated. Please take a look. |

fix #38