Skip to content

fix(#257): remove duplicate imports in oracles_test and add oracle quality gate to CI#346

Merged
hman38705 merged 1 commit intosolutions-plug:mainfrom
temma02:fix/257-oracle-duplicate-imports-clippy-gate
Mar 28, 2026
Merged

fix(#257): remove duplicate imports in oracles_test and add oracle quality gate to CI#346
hman38705 merged 1 commit intosolutions-plug:mainfrom
temma02:fix/257-oracle-duplicate-imports-clippy-gate

Conversation

@temma02
Copy link
Copy Markdown
Contributor

@temma02 temma02 commented Mar 27, 2026

Problem

oracles_test.rs imported ErrorCode and OracleConfig explicitly with
use crate::errors::ErrorCode;
use crate::types::OracleConfig;
while also doing 'use super::oracles::*', which already pulls both symbols into scope via oracles.rs's own top-level use declarations. The redundant lines are dead imports that clippy -D warnings would flag as errors, and they signal a hygiene gap in the module.

Additionally, the existing 'clippy' CI job ran in isolation with no dependency from the test jobs, so a clippy regression in the oracle module could not block a merge.

Changes

contracts/predict-iq/src/modules/oracles_test.rs

  • Remove 'use crate::errors::ErrorCode' (already in scope via glob).
  • Remove 'use crate::types::OracleConfig' (already in scope via glob).

.github/workflows/test.yml

  • Add 'oracle-quality-gate' job: 1. cargo clippy --package predict-iq --all-features -- -D warnings with RUSTFLAGS=-D warnings so compiler warnings are also fatal. 2. cargo build --package predict-iq --all-features with the same RUSTFLAGS, catching any warning the clippy pass might miss. 3. cargo test --package predict-iq --lib oracles to confirm the oracle unit tests pass as part of the same gate.
  • Add 'oracle-quality-gate' to the 'needs' list of 'all-tests-passed' so the gate is required for every PR targeting main/develop.

closes #257

… add oracle quality gate to CI

Problem
-------
oracles_test.rs imported ErrorCode and OracleConfig explicitly with
  use crate::errors::ErrorCode;
  use crate::types::OracleConfig;
while also doing 'use super::oracles::*', which already pulls both
symbols into scope via oracles.rs's own top-level use declarations.
The redundant lines are dead imports that clippy -D warnings would
flag as errors, and they signal a hygiene gap in the module.

Additionally, the existing 'clippy' CI job ran in isolation with no
dependency from the test jobs, so a clippy regression in the oracle
module could not block a merge.

Changes
-------
contracts/predict-iq/src/modules/oracles_test.rs
  - Remove 'use crate::errors::ErrorCode' (already in scope via glob).
  - Remove 'use crate::types::OracleConfig' (already in scope via glob).

.github/workflows/test.yml
  - Add 'oracle-quality-gate' job:
      1. cargo clippy --package predict-iq --all-features -- -D warnings
         with RUSTFLAGS=-D warnings so compiler warnings are also fatal.
      2. cargo build --package predict-iq --all-features with the same
         RUSTFLAGS, catching any warning the clippy pass might miss.
      3. cargo test --package predict-iq --lib oracles to confirm the
         oracle unit tests pass as part of the same gate.
  - Add 'oracle-quality-gate' to the 'needs' list of 'all-tests-passed'
    so the gate is required for every PR targeting main/develop.
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Mar 27, 2026

@temma02 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@hman38705 hman38705 merged commit a479d54 into solutions-plug:main Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix duplicate imports and add clippy/test gate in CI for oracle module

2 participants