conda-forge / conda-smithy

The tool for managing conda-forge feedstocks.
https://conda-forge.org/
BSD 3-Clause "New" or "Revised" License
146 stars 170 forks source link

Validation error with `github_actions` provider #1880

Closed jakirkham closed 4 months ago

jakirkham commented 4 months ago

When using GitHub Actions as a provider and specifying GitHub Actions config in conda-forge.yml (snippet below):

...
github_actions:
  artifact_retention_days: 7
  free_disk_space: true
  upload_packages: true
provider:
  linux: github_actions
  linux_aarch64: github_actions
  osx: github_actions
  win: github_actions

The following validation error comes up:

  + Exception Group Traceback (most recent call last):
  |   File "/Users/jkirkham/miniforge/bin/conda-smithy", line 10, in <module>
  |     sys.exit(main())
  |   File "/Users/jkirkham/miniforge/lib/python3.10/site-packages/conda_smithy/cli.py", line 733, in main
  |     args.subcommand_func(args)
  |   File "/Users/jkirkham/miniforge/lib/python3.10/site-packages/conda_smithy/cli.py", line 584, in __call__
  |     self._call(args, tmpdir)
  |   File "/Users/jkirkham/miniforge/lib/python3.10/site-packages/conda_smithy/cli.py", line 589, in _call
  |     configure_feedstock.main(
  |   File "/Users/jkirkham/miniforge/lib/python3.10/site-packages/conda_smithy/configure_feedstock.py", line 2533, in main
  |     config = _load_forge_config(forge_dir, exclusive_config_file, forge_yml)
  |   File "/Users/jkirkham/miniforge/lib/python3.10/site-packages/conda_smithy/configure_feedstock.py", line 2087, in _load_forge_config
  |     config = _read_forge_config(forge_dir, forge_yml=forge_yml)
  |   File "/Users/jkirkham/miniforge/lib/python3.10/site-packages/conda_smithy/configure_feedstock.py", line 2003, in _read_forge_config
  |     raise ExceptionGroup("lints", [*map(ValueError, validate_lints)])
  | exceptiongroup.ExceptionGroup: lints (1 sub-exception)
  +-+---------------- 1 ----------------
    | ValueError: {'artifact_retention_days': 7, 'free_disk_space': True, 'upload_packages': True} is not valid under any of the given schemas
    | 
    | Failed validating 'anyOf' in schema['properties']['github_actions']:
    |     {'anyOf': [{'$ref': '#/$defs/GithubActionsConfig'}, {'type': 'null'}],
    |      'description': 'GitHub Actions CI settings. This is usually read-only '
    |                     'and should not normally be\n'
    |                     'manually modified. Tools like conda-smithy may modify '
    |                     'this, as needed.'}
    | 
    | On instance['github_actions']:
    |     {'artifact_retention_days': 7,
    |      'free_disk_space': True,
    |      'upload_packages': True}
    +------------------------------------

AFACIT the configuration is valid (and has worked for a while)

Less sure what the schema expects here. Maybe the GithubActionsConfig is missing keys? Looks like free_disk_space is missing, but maybe more changes than that are needed

jakirkham commented 4 months ago

Appears to be resolved with PR: https://github.com/conda-forge/conda-smithy/pull/1882