Repository navigation
refactor(compile): reduce complexity of check_pipeline in src/compile/mod.rs - #2243
Draft
github-actions[bot] wants to merge 1 commit into
Draft
github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
…/mod.rs Split the 105-line check_pipeline function (clippy::too_many_lines) into four focused pieces: - warn_on_version_mismatch: version-drift warning - resolve_header_source_path: repo-root + header source path resolution - compile_fresh_from_header_source: read source, run codemods/import merge/repo resolution, and compile fresh YAML - check_pipeline: orchestrates the steps above and reports the diff No behavior change; clippy::too_many_lines no longer flags this file and all check_pipeline-exercising tests (tests/codemod_tests.rs) plus the full test suite pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
This branch has not been deployed
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.
Summary
clippy::cognitive_complexityproduced no diagnostics under this toolchain (clippy 0.1.98) — it is documented asrestriction-only and effectively inert, suggestingtoo_many_lines/excessive_nestingas replacements. Running those surfacedcheck_pipelineinsrc/compile/mod.rsat 105/100 lines (clippy::too_many_lines), the largest untouched, non-test production function not already covered by prior refactor runs.What changed
Split
check_pipelineinto four focused pieces, preserving all logic and comments verbatim:warn_on_version_mismatch— stderr warning when the pipeline's header compiler version differs from the current one.resolve_header_source_path— resolves the header's relative source path against the repo root found by walking up from the pipeline file.compile_fresh_from_header_source— reads the source markdown, applies the pending-codemod guard, resolves/merges imports, sanitizes config, resolves repos, and compiles fresh YAML (returns(pipeline_yaml, pipeline_name)).check_pipeline— orchestrates the steps above and reports the integrity diff.No public API changed and no observable behavior changed — only structure.
Verification
cargo build --all-features— clean.cargo clippy --all-targets --all-features— no warnings.cargo clippy -- -W clippy::too_many_lines—check_pipelineno longer flagged.cargo test— full suite passes (3406+ tests, includingtests/codemod_tests.rs, which directly exercises thecheckCLI command /check_pipeline).Before / after
clippy::too_many_linescompile_fresh_from_header_source~70 lines)Warning
Firewall blocked 2 domains
The following domains were blocked by the firewall during workflow execution:
releaseassets.githubusercontent.comspsprodeus21.vssps.visualstudio.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.