Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests.nixpkgs-check-by-name: Implement gradual empty arg check migration #272395

Merged
merged 10 commits into from
Dec 15, 2023

Commits on Dec 14, 2023

  1. tests.nixpkgs-check-by-name: Minor refactor, allow more simultaneous …

    …problems
    
    This makes it such that these two errors can both be thrown for a single
    package:
    - The attribute value not being a derivation
    - The attribute not being a proper callPackage
    
    The tests had to be adjusted to only throw the error they were testing
    for
    infinisil committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    b8e4d55 View commit details
    Browse the repository at this point in the history
  2. tests.nixpkgs-check-by-name: Introduce result_map

    Convenience function to run another validation over a successful validation result.
    
    This will be usable in more locations in future commits, making the code
    nicer.
    infinisil committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    e98d228 View commit details
    Browse the repository at this point in the history
  3. tests.nixpkgs-check-by-name: Intermediate refactor

    This prepares the code base for the removal of the `--version` flag, to
    be replaced with a flag that can specify a base version to compare the
    main Nixpkgs against, in order to have gradual transitions to stricter
    checks.
    
    This refactoring does:
    - Introduce the `version` module that can house the logic to increase
      strictness, with a `version::Nixpkgs` struct that contains the
      strictness conformity of a single Nixpkgs version
    - Make the check return `version::Nixpkgs`
    - Handle the behavior of the still-existing `--version` flag with `version::Nixpkgs`
    - Introduce an intermediate `process` function to handle the top-level
      logic, especially useful in the next commit
    infinisil committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    a6ba4ca View commit details
    Browse the repository at this point in the history
  4. tests.nixpkgs-check-by-name: Gradual migration from base Nixpkgs

    This implements the option for a gradual migration to stricter checks.
    For now this is only done for the check against empty non-auto-called
    callPackage arguments, but in the future this can be used to ensure all
    new packages make use of `pkgs/by-name`.
    
    This is implemented by adding a `--base <BASE_NIXPKGS>` flag, which then
    compares the base nixpkgs against the main nixpkgs version, making sure
    that there are no regressions.
    
    The `--version` flag is removed. While it was implemented, it was never
    used in CI, so this is fine.
    infinisil committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    d487a97 View commit details
    Browse the repository at this point in the history
  5. tests.nixpkgs-check-by-name: Test for gradual transition

    This implements the ability to test gradual transitions in check
    strictness, and adds one such test for the empty non-auto-called
    arguments check.
    infinisil committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    bb08bfc View commit details
    Browse the repository at this point in the history

Commits on Dec 15, 2023

  1. tests.nixpkgs-check-by-name: Fix and document behavior without --base

    Previously, not passing `--base` would enforce the most strict checks.
    While there's currently no actual violation of these stricter checks,
    this does not match the previous behavior.
    
    This won't matter once CI passes `--base`, the code handling the
    optionality can be removed then.
    infinisil committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    53b43ce View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    413dd9c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    79618ff View commit details
    Browse the repository at this point in the history
  4. tests.nixpkgs-check-by-name: Move interface description into code

    This would be duplicated otherwise
    infinisil committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    74e8b38 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    fc2d269 View commit details
    Browse the repository at this point in the history