Skip to content

Conversation

@tcornell-bus
Copy link
Collaborator

@tcornell-bus tcornell-bus commented Dec 18, 2025

Do not require the project key in reportportal plugin schema since it can be specified in TMT_PLUGIN_REPORT_REPORTPORTAL_PROJECT environment var or on the command line.

The reportportal plugin code appears to already handle when the project key is not specified in any of the allowed forms. It throws an exception.

The added test requires reportportal access and can be run locally. Since I do not have access to test_tmt reportportal project, I used my personal project for testing.

I went down a rabbit hole of trying to fix the tests in tests/report/reportportal/data/test.fmf, but it was taking a considerable amount of time. I am about halfway through fixing them, so I may follow up with a PR to fix those.

Fixes: #4178

Pull Request Checklist

  • implement the feature
  • extend the test coverage
  • modify the json schema
  • include a release note

plugin schema since it can be specified in
TMT_PLUGIN_REPORT_REPORTPORTAL_PROJECT environment var
or on the commandline.

The reportportal plugin code appears to alredy handle
when the project key is not specified in any of the allowed
forms. It throws an exception.

The added test requires reportportal access and can be run
locally.
back to the default test_tmt
@tcornell-bus tcornell-bus added step | report Stuff related to the report step code | schema Schema used for validating config files plugin | reportportal The reportportal report plugin review | trivial Very easy for review, even for beginners, so don't be afraid to have a look! :-) labels Dec 18, 2025
@tcornell-bus tcornell-bus changed the title Tcornell reportportal schema no req project key reportportal schema should not require the project key Dec 18, 2025
@tcornell-bus tcornell-bus changed the title reportportal schema should not require the project key reportportal schema should not require project key Dec 19, 2025
@github-project-automation github-project-automation bot moved this to backlog in planning Jan 6, 2026
@tcornell-bus tcornell-bus moved this from backlog to review in planning Jan 6, 2026
@tcornell-bus tcornell-bus removed the review | trivial Very easy for review, even for beginners, so don't be afraid to have a look! :-) label Jan 6, 2026
@psss psss added the status | discuss Needs more discussion before closing label Jan 6, 2026
@psss psss added this to the 1.65 milestone Jan 8, 2026
@thrix thrix moved this from review to implement in planning Jan 13, 2026
@thrix
Copy link
Contributor

thrix commented Jan 13, 2026

From the discussion at hacking meeting turn the missing required key a warning in tmt lint and keep the key as required.

File a new issue to track a proper fix which would ignore the schema and use the step data of the plugin for validation of the required keys and drop the required keys from the schema.

@tcornell-bus
Copy link
Collaborator Author

Closing in favor of #4481

@github-project-automation github-project-automation bot moved this from implement to done in planning Jan 13, 2026
happz pushed a commit that referenced this pull request Jan 18, 2026
The original intention was to implement what is said in this
[comment](#4445 (comment)).
The issue I ran into is that when I have `tmt lint` emit a schema (pass
or warn) if the only error is the `detect_missing_required_properties`,
then it still fails because almost always this check
`detect_enum_violations` also fails when a required key is missing.
`detect_enum_violations` is triggered when `how` is used and the
required key is missing because it cycles through all of the values and
tells you when the first 9/10 did not match.

Cursor analysis of why this occurs (better explanation than mine):
> Explaining why enum violations only appear when the required property
is missing:
> The schema uses `oneOf` for the report step, which requires exactly
one schema to match. Here's what happens:
> When the `project` key (required property) is present:
> The `reportportal` schema matches (`how: reportportal` and `project`
are present)
> Since `oneOf` requires exactly one match and reportportal matches,
validation succeeds
> No enum violations occur because the validator doesn't try other
schemas
> When the `project` key (required property) is missing:
> The `reportportal` schema fails (missing required `project`)
> Since `oneOf` requires exactly one match and `reportportal` failed,
the validator tries other schemas (display, html, junit, polarion)
> Each alternative fails because `how: reportportal` doesn't match their
enum values (they expect how: display, how: html, etc.)
> These enum violations are reported as the validator tries each
alternative

So, it's not simple to turn _only_ the missing required key into a
warning in `tmt lint` since even if that error is not counted, another
error still occurs, still resulting in an overall `tmt lint` failure.

After some discussion with @LecrisUT, @happz, and @thrix, reverting the
FAIL to a WARN would unblock the CI failures for #4178, while we work on
a better overall solution where #3618 can be reimplemented, and #4178 is
still resolved. The ticket for the better solution is #4483

This PR reverts the tmt lint schema failure implemented to fix issue
#3618.

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

Labels

code | schema Schema used for validating config files plugin | reportportal The reportportal report plugin status | discuss Needs more discussion before closing step | report Stuff related to the report step

Projects

Status: done

Development

Successfully merging this pull request may close these issues.

Misleading lint messages for reportportal

4 participants