Skip to content

Conversation

@mcasquer
Copy link
Contributor

@mcasquer mcasquer commented Jan 22, 2026

As tmt running in RHEL 8 is no longer supported, remove the schema workarounds referencing RHEL-8

Fixes #3705

  • modify the json schema

@psss
Copy link
Contributor

psss commented Jan 22, 2026

/packit build

@psss psss changed the title Removes RHEL-8 workarounds from old jsonschema Remove RHEL-8 workarounds from old jsonschema Jan 22, 2026
Comment on lines -123 to -125
# NOTE: Because of old jsonschema package on RHEL-8, we cannot use
# `url: true` and inherit `url` attributes from parent schema. It
# seems like we have to repeat properties schemas here as well.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had my suspicion about this comment, and I tried it with the following example:

/tests:
  /valid:
    test: something
    require:
      - url: https://github.com/beakerlib/beakerlib
        type: library
        name: /example
  /invalid:
    test: something
    require:
      - url: 12345
        type: library
        name: { }

With the changes here, the invalid one always passes the schema, while previously it failed correctly. Best option here is to just delete these comments and revert the rest.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the options such as url: true are not valid, we still need to redefine them, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the previous way of defining them was correct. Maybe just needing more $ref indirections.

# seems like we have to repeat properties schemas here as well.
properties:
url:
# https://github.com/teemtee/tmt/issues/1258
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure this comment is preserved, it is still very much relevant

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done :)

Signed-off-by: mcasquer <mcasquer@redhat.com>
@mcasquer mcasquer force-pushed the remove_rhel8_workarounds branch from d680838 to f5ad1fa Compare January 23, 2026 08:20
Signed-off-by: mcasquer <mcasquer@redhat.com>
@mcasquer mcasquer force-pushed the remove_rhel8_workarounds branch from 08580b7 to 62dc046 Compare January 23, 2026 09:27
@mcasquer
Copy link
Contributor Author

What about the tmp_path* fixtures that are not available at RHEL-8, I see we have a workaround at

class TempPathFactory:

I'm not sure of the magnitude of what this implies, or if it's good as it is now :)
cc @LecrisUT @happz

@LecrisUT
Copy link
Contributor

What about the tmp_path* fixtures that are not available at RHEL-8, I see we have a workaround at

class TempPathFactory:

I'm not sure of the magnitude of what this implies, or if it's good as it is now :) cc @LecrisUT @happz

Based on

# * a wrapper class, representing the "tmp path factory". It's initialized with an
# actual factory, has the same public API, but returns our `tmt.utils.Path`
# * two new fixtures, `tmppath` and `tmppath_factory` that consume available fixtures
# and return corresponding `tmt.utils.Path`.
# * tests using `tmppath*` instead of pytest's own `tmp_path*` and `tmpdir*` fixtures
#

We still need to keep it, but the try ... except in there can be simplified. What I don't know if it was invesitgated, what happens if we also provide a pytest.fixture with the same name tmp_path or have any way to keep the tmp_path name but edit the output type.

But the minimum blast radius would be to just simplify the try ... except and that should not have any side-effects, so start from there.

@happz
Copy link
Contributor

happz commented Jan 23, 2026

What about the tmp_path* fixtures that are not available at RHEL-8, I see we have a workaround at

class TempPathFactory:

I'm not sure of the magnitude of what this implies, or if it's good as it is now :) cc @LecrisUT @happz

If you keep tmppath and tmppath_factory working as they are today, and drop the backward compatibility, the it should be harmful and remove one old piece of code.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove unnecessary "RHEL-8 workarounds"

5 participants