fix(ci): unbreak python + contracts jobs on main#27
Merged
Conversation
Root cause ---------- Both jobs on default branch have been red since 2026-04-09. Two independent issues, both introduced by merged external PRs: 1. contracts job — `npm ci` fails with EUSAGE: no package-lock.json exists in deploy/. The hardhat scaffold (PR #22, multi-chain deploy) was merged without a committed lockfile. 2. python job — three failures: - tests/unit/connectors/test_websocket_feed.py (PR #21) uses `@pytest.mark.asyncio` + `async def` but pytest-asyncio isn't in requirements.txt, so pytest errors with "async def functions are not natively supported". - tests/integration/test_chainlink.py::test_unknown_pair_raises uses `patch.object(oracle, "w3")`, but `w3` is a @Property. On modern mock this evaluates the property during patch setup, which triggers a real HTTP connection attempt to http://localhost:8545 and raises OracleConnectionError before the test body runs. Fix --- - deploy/package-lock.json: committed so `npm ci` has something to install. - requirements.txt: add pytest-asyncio>=0.23.0. - pytest.ini: new — sets asyncio_mode=auto and registers the asyncio marker so async tests run and marker warnings stop. - tests/integration/test_chainlink.py: patch `oracle._w3` directly (the underlying attribute) instead of the `w3` property — no real network calls, test_unknown_pair_raises now correctly exercises the OracleFeedNotFound path. - .gitignore: ignore node_modules/, deploy/artifacts/, deploy/cache/. Verification ------------ Local: `python -m pytest tests/` → 79 passed, 2 skipped (live-net tests skipped when WEB3_PROVIDER_URL_SEPOLIA unset), 0 failed. Local: `cd deploy && rm -rf node_modules && npm ci && npx hardhat compile` → clean install + "Nothing to compile" (no .sol sources wired to hardhat config yet — separate issue from CI green). — [kcolbchain](https://kcolbchain.com) / [Abhishek Krishna](https://abhishekkrishna.com)
2 tasks
abhicris
added a commit
that referenced
this pull request
Apr 23, 2026
PR #27 unbroke `npx hardhat compile` (got `npm ci` working), but the job still output "Nothing to compile" — hardhat looked at `deploy/contracts/` which doesn't exist; the repo's Solidity sources live in `contracts/` at the repo root. This wires them up properly: - `paths.root = ".."` + `paths.sources = "contracts"` points hardhat at the real source tree. `paths.tests` / `paths.cache` / `paths.artifacts` follow the same root-relative convention so the structure stays clean. - Solidity bumped to `0.8.26` with `evmVersion: "cancun"` because `@openzeppelin/contracts ^5.0.0` (already in `package.json`) uses `mcopy` in `utils/Memory.sol`, which needs the cancun opcode. Verification (locally, from `deploy/`): ``` $ rm -rf cache artifacts && npx hardhat compile Compiled 24 Solidity files successfully (evm target: cancun). ``` The `contracts` CI job on main will now actually type-check the four Solidity files we ship — `MeridianVault.sol`, `MeridianVaultERC4626.sol` (ERC-4626 vault-share token), `OracleAdapter.sol`, `StrategyExecutor.sol` — instead of silently succeeding on an empty source set. Follow-up (separate PR): fix the `_getChainlinkPrice(pairId, ...)` vs `pairId(string)` name-shadowing warning in OracleAdapter.sol. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
abhicris
added a commit
that referenced
this pull request
Apr 23, 2026
…un (#32) PR #27 unbroke `npx hardhat compile` (got `npm ci` working), but the job still output "Nothing to compile" — hardhat looked at `deploy/contracts/` which doesn't exist; the repo's Solidity sources live in `contracts/` at the repo root. This wires them up properly: - `paths.root = ".."` + `paths.sources = "contracts"` points hardhat at the real source tree. `paths.tests` / `paths.cache` / `paths.artifacts` follow the same root-relative convention so the structure stays clean. - Solidity bumped to `0.8.26` with `evmVersion: "cancun"` because `@openzeppelin/contracts ^5.0.0` (already in `package.json`) uses `mcopy` in `utils/Memory.sol`, which needs the cancun opcode. Verification (locally, from `deploy/`): ``` $ rm -rf cache artifacts && npx hardhat compile Compiled 24 Solidity files successfully (evm target: cancun). ``` The `contracts` CI job on main will now actually type-check the four Solidity files we ship — `MeridianVault.sol`, `MeridianVaultERC4626.sol` (ERC-4626 vault-share token), `OracleAdapter.sol`, `StrategyExecutor.sol` — instead of silently succeeding on an empty source set. Follow-up (separate PR): fix the `_getChainlinkPrice(pairId, ...)` vs `pairId(string)` name-shadowing warning in OracleAdapter.sol. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
Default-branch CI has been red since 2026-04-09. Two independent issues, both introduced by recently merged external PRs:
contractsjob —npm cifails withEUSAGE: nopackage-lock.jsonindeploy/. The hardhat scaffold (feat: add multi-chain deployment support (Arbitrum, Optimism, Base) #22 multi-chain deploy) was merged without a committed lockfile.pythonjob — three test failures:tests/unit/connectors/test_websocket_feed.py(from feat: add WebSocket price streaming for live market data #21) uses@pytest.mark.asyncio+async defbutpytest-asyncioisn't inrequirements.txt, so pytest emitsFailed: async def functions are not natively supported.tests/integration/test_chainlink.py::test_unknown_pair_raisesusespatch.object(oracle, "w3"), butw3is a@property. On modernmock,patch.objectevaluates the property during setup, triggering a real HTTP connect attempt tohttp://localhost:8545and raisingOracleConnectionErrorbefore the test body executes.Fix
deploy/package-lock.json— committed sonpm cihas something to install.requirements.txt— addpytest-asyncio>=0.23.0.pytest.ini(new) —asyncio_mode = autoand register theasynciomarker so async tests run and marker warnings stop.tests/integration/test_chainlink.py— patchoracle._w3(the underlying attribute) instead of thew3property; test now correctly exercises theOracleFeedNotFoundpath without touching the network..gitignore— ignorenode_modules/,deploy/artifacts/,deploy/cache/.Verification
python -m pytest tests/locally → 79 passed, 2 skipped (2 skips are live-Sepolia tests, correctly skipped whenWEB3_PROVIDER_URL_SEPOLIAunset), 0 failed.cd deploy && rm -rf node_modules && npm ci && npx hardhat compilelocally → clean install, "Nothing to compile" (no.solsources wired to hardhat config yet — separate issue, not the CI break).Out of scope
contracts/*.solinto hardhat config — separate repo-structure cleanup.— kcolbchain / Abhishek Krishna