mxcube / mxcubecore

Backend used by MXCuBE
http://mxcube.github.io/mxcube/
GNU Lesser General Public License v3.0
11 stars 51 forks source link

Testing breaks on new yaml #960

Open rhfogh opened 1 week ago

rhfogh commented 1 week ago

Could someone have a look at how the testing inteeracts with my newest PRs, e.g. mxcubecore #958, or mxcubeweb #1289?

I am getting all failures, with errors like

Invalid workflow file: .github/workflows/build_and_test.yml#L1 You have an error in your yaml syntax

This is from adding %YAML 1.2 as the first line. The thing is, this shoudl be OK sybntax for YAML 1.23 (see e.g. https://yaml.org/spec/1.2.1/), and when testing yamllint witin pycharm you clearly need to have that line (*without starting the line with a hash) to get the directive to work and enforce yaml 1.2 (and so not interpret e.g. on as a boolean).

Some questions: Which version of yamllint and which yaml reader is used in testing? Could it be too old? Which yaml config is used in testing?

I am so unfamiliar with the testing framwork that someone else could do this a lot quicker than I could.

fabcor-maxiv commented 1 week ago

@rhfogh I will look at this

fabcor-maxiv commented 1 week ago

Which version of yamllint [...] is used in testing?

@rhfogh You can see this in the .pre-commit-config.yaml file. It is currently set to version 1.35.1, which is the current latest:

https://github.com/mxcube/mxcubecore/blob/857c1b579866aab14a3907765217d8734484f2cb/.pre-commit-config.yaml#L8-L9

rhfogh commented 1 week ago

@fabcor-maxiv I am using version 1.35.1, installed locally under conda. The system yamllint (installed through Yast) is 1.22 - they do not seem to have anything newer in my repositories, but I have set the link in PyCharm to the in-conda version.

fabcor-maxiv commented 1 week ago

My guess is that it is simply GitHub's parser (at least the one for its GitHub Actions workflows) that does not handle the %YAML 1.2 directive. I will try to find a confirmation for this (directly from GitHub themselves if possible).

fabcor-maxiv commented 1 week ago

This seems to back up the theory that only a subset of YAML is supported, but I do not see it as a clear confirmation: https://github.com/orgs/community/discussions/118688

fabcor-maxiv commented 1 week ago

I could not find a clear confirmation from GitHub's side that the presence of the %YAML 1.2 directive is what trips up their parser, but I am quite confident that it is what triggers the issue on our side.