Skip to content

Decide whether questions should weigh the conditions commands run under (if:, Make requirements) #361

Backlog

Description

@leftibot

To decide later: should the questions weigh the conditions a command runs under?

Today

A command that may not run in every build still counts as running wherever its job runs. Two kinds of facts carry such a condition:

CMake's and Meson's build facts already carry Applies (the builds an option holds in), so build settings are weighed this way; CI commands are not.

Why it matters

It over-reports. In the #360 corpus run, argo-cd's make test-e2e-local builds with -cover only if the environment sets COVERAGE_ENABLED=true. The step doesn't set it, but Go statement coverage is credited to the whole project anyway.

What deciding would involve

  • Fact model: give Command (and ToolRun) the condition it runs under, as a Condition or as Applies disjuncts, instead of condition: str.
  • Questions: decide what a conditional run proves. For example, "measures coverage" could need a run that holds unconditionally, with a conditional one reported as a note or as unknown, the way unknown answers are handled today.
  • Every provider: GitHub if:, GitLab rules:/only:, Make requirements, and later anything else that runs conditionally.
  • Requirements: check whether the job's own environment settles them. Many are set or left unset by the CI job itself, for example COVERAGE_ENABLED not appearing in the step's env.

Related, smaller

Evaluating $(filter …) and MAKECMDGOALS from the goals make was given would settle cases like uutils/coreutils's PROFILE?=release under ifneq (,$(filter install, $(MAKECMDGOALS))), which now lists Release for make build.

Part of #300.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions