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

Add the link command and linking new tests to jira #2922

Merged
merged 30 commits into from
Sep 30, 2024
Merged

Conversation

tkoscieln
Copy link
Collaborator

@tkoscieln tkoscieln commented May 9, 2024

Pull Request Checklist

  • implement the feature
  • write the documentation
  • extend the test coverage
  • mention the version
  • include a release note

@psss psss changed the title Add link command and linking to jira on new issues. Add link command and linking to jira on new issues May 9, 2024
@LecrisUT
Copy link
Contributor

LecrisUT commented May 9, 2024

Could use an example of how this works. Probably this needs to be abstracted a bit for more arbitrary issue providers. Are there no plans yet to strip out some of the tmt plugins in order to minimize the dependencies and tests?

@tkoscieln
Copy link
Collaborator Author

tkoscieln commented May 9, 2024

Could use an example of how this works. Probably this needs to be abstracted a bit for more arbitrary issue providers. Are there no plans yet to strip out some of the tmt plugins in order to minimize the dependencies and tests?

This is currently WIP, hence why it is in Draft. Will provide more information once the initial refactor suggested by @psss in a discussion will be implemented.

@tkoscieln
Copy link
Collaborator Author

Added a section to documentation which should explain what this change aims to introduce. Related Jira issue TT-262.

@LecrisUT
Copy link
Contributor

Thanks for the clarification I kinda understand the setup, and I am more confused about it at the same time. The main idea is to add in the Issue links a link to the tmt test/plan/story that would fix a specific issue. The confusing part is the usage of the service field. This seems to imply that the tmt metadata is served somehow probably as teemtee/web? That part should be advertised a bit more if that is the only linkage that would be supported. What about general audience?

Another question I have is what happens with the links when a test/structure gets refactored. Could the tests be traced back through the git tree to see how it evolves and re-links?

tmt/base.py Outdated Show resolved Hide resolved
tmt/base.py Outdated Show resolved Hide resolved
tmt/cli.py Outdated Show resolved Hide resolved
tmt/cli.py Outdated Show resolved Hide resolved
tmt/utils.py Outdated Show resolved Hide resolved
tmt/utils.py Outdated Show resolved Hide resolved
docs/guide.rst Outdated Show resolved Hide resolved
docs/guide.rst Outdated Show resolved Hide resolved
tmt/utils.py Outdated Show resolved Hide resolved
tmt/utils.py Outdated Show resolved Hide resolved
tmt/base.py Outdated Show resolved Hide resolved
tmt/base.py Outdated Show resolved Hide resolved
tmt/base.py Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
Copy link
Collaborator

@psss psss left a comment

Choose a reason for hiding this comment

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

Thanks a lot for working on this! Overall looks very good. Added some comments and suggestions.

docs/guide.rst Outdated Show resolved Hide resolved
docs/guide.rst Outdated Show resolved Hide resolved
docs/guide.rst Outdated Show resolved Hide resolved
docs/guide.rst Outdated Show resolved Hide resolved
tmt/cli.py Outdated Show resolved Hide resolved
tmt/utils.py Outdated Show resolved Hide resolved
tmt/utils.py Outdated Show resolved Hide resolved
tmt/utils.py Outdated Show resolved Hide resolved
tmt/utils.py Outdated Show resolved Hide resolved
tmt/utils.py Outdated Show resolved Hide resolved
@psss psss added this to the 1.35 milestone Jun 4, 2024
@martinhoyer martinhoyer modified the milestones: 1.35, 1.36 Jul 30, 2024
@psss
Copy link
Collaborator

psss commented Aug 7, 2024

This is an important feature blocking proper Jira integration and traceability. Marking as a must have. Let's try hard to finish this in 1.36..

@psss psss added priority | must high priority, must be included in the next release command | link tmt link command labels Aug 7, 2024
@psss
Copy link
Collaborator

psss commented Aug 9, 2024

@tkoscieln, could you please address the comments and add a short release note? Thanks!

docs/guide.rst Outdated Show resolved Hide resolved
happz and others added 13 commits September 30, 2024 11:53
Traceback (most recent call last):
  File "/home/psss/.local/share/hatch/env/virtual/tmt/v_yBwOy-/dev/bin/tmt", line 5, in <module>
    from tmt.__main__ import run_cli
  File "/home/psss/git/tmt/tmt/__init__.py", line 20, in <module>
    from tmt.base import Clean, Plan, Run, Status, Story, Test, Tree
  File "/home/psss/git/tmt/tmt/base.py", line 57, in <module>
    import tmt.utils.jira
  File "/home/psss/git/tmt/tmt/utils/jira.py", line 21, in <module>
    tmt.log.Logger.get_bootstrap_logger())
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/psss/git/tmt/tmt/log.py", line 871, in get_bootstrap_logger
    cls._bootstrap_logger = Logger.create(actual_logger=actual_logger)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/psss/git/tmt/tmt/log.py", line 686, in create
    return Logger(
           ^^^^^^^
  File "/home/psss/git/tmt/tmt/log.py", line 629, in apply_verbosity_options
    debug_level_from_global_envvar = _debug_level_from_global_envvar()
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/psss/git/tmt/tmt/log.py", line 123, in _debug_level_from_global_envvar
    raise tmt.utils.GeneralError(f"Invalid debug level '{raw_value}', use an integer.")
tmt.utils.GeneralError: Invalid debug level 'weird', use an integer.
Move under `Elasticity`
Simplify some wording.
Use the planned `tmt-web-url`.
Extra line
Duplicate requires
Missing docstrings
Consistent option name
Introduce the `JiraInstance` class
Separate code into more functions/methods.
Simplify object detection in `cli.py`, handle empty case.
@psss
Copy link
Collaborator

psss commented Sep 30, 2024

I believe all crucial comments should be covered. I suggest to include this new functionality as a Tech Preview in 1.37 with the primary goal to gather feedback from users about the proposed implementation. Please, review, as this is the last remaining must-have pull request.

@psss psss requested a review from LecrisUT September 30, 2024 10:15
Copy link
Collaborator

@psss psss left a comment

Choose a reason for hiding this comment

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

After changes in 7ecd3bb should be good to go.

Copy link
Collaborator

@martinhoyer martinhoyer left a comment

Choose a reason for hiding this comment

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

Nice!
One last thought - should jira.py be under tmt/utils/? Doesn't feel right to me. Non-blocking of course, can be moved later if desired.

tmt/cli.py Show resolved Hide resolved
@psss
Copy link
Collaborator

psss commented Sep 30, 2024

The /tests/unit/with-system-packages/extended test fails with a weird error:

stderr     = ('dnf5: error while loading shared libraries: libfmt.so.10: cannot open shared '
'object file: No such file or directory\n')

Does not seem to be related. Rerunning though.

@psss
Copy link
Collaborator

psss commented Sep 30, 2024

One last thought - should jira.py be under tmt/utils/? Doesn't feel right to me. Non-blocking of course, can be moved later if desired.

Ack, yeah, we can find a better place for it in the future.

@psss psss added the status | ready for merge The only missing piece is to do the rebase the current 'main' and let the CI finish. label Sep 30, 2024
@psss
Copy link
Collaborator

psss commented Sep 30, 2024

Failures seem to be related to dnf in the fedora-39 container. Merging.

@psss psss merged commit cddc98e into main Sep 30, 2024
22 of 23 checks passed
@psss psss deleted the link-issues-to-jira branch September 30, 2024 13:22
@psss psss self-assigned this Sep 30, 2024
@psss psss changed the title Add link command and linking to jira on new issues Add the link command and linking new tests to jira Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci | full test Pull request is ready for the full test execution command | link tmt link command priority | must high priority, must be included in the next release status | ready for merge The only missing piece is to do the rebase the current 'main' and let the CI finish.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants