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

Remote plan with an invalid url gives a traceback #1650

Closed
psss opened this issue Oct 27, 2022 · 3 comments · Fixed by #1658
Closed

Remote plan with an invalid url gives a traceback #1650

psss opened this issue Oct 27, 2022 · 3 comments · Fixed by #1658
Assignees
Labels
command | import The import command command | plans tmt plans command

Comments

@psss
Copy link
Collaborator

psss commented Oct 27, 2022

Reproducible easily:

plan:
    import:
        url: https://some.weird.url/

Exploring the tree with tmt gives:

Traceback (most recent call last):
  File "/home/psss/.virtualenvs/tmt/bin/tmt", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/home/psss/git/tmt/bin/tmt", line 20, in <module>
    tmt.cli.main()
  File "/home/psss/.virtualenvs/tmt/lib/python3.10/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/psss/.virtualenvs/tmt/lib/python3.10/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/psss/.virtualenvs/tmt/lib/python3.10/site-packages/click/core.py", line 1637, in invoke
    super().invoke(ctx)
  File "/home/psss/.virtualenvs/tmt/lib/python3.10/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/psss/.virtualenvs/tmt/lib/python3.10/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/psss/.virtualenvs/tmt/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/psss/git/tmt/tmt/cli.py", line 148, in main
    tmt.Plan.overview(tree)
  File "/home/psss/git/tmt/tmt/base.py", line 1218, in overview
    style(str(plan), fg='red') for plan in tree.plans()]
  File "/home/psss/git/tmt/tmt/base.py", line 2120, in plans
    return [plan.import_plan() or plan for plan in plans]
  File "/home/psss/git/tmt/tmt/base.py", line 2120, in <listcomp>
    return [plan.import_plan() or plan for plan in plans]
  File "/home/psss/git/tmt/tmt/base.py", line 1616, in import_plan
    node = fmf.Tree.node(
  File "/home/psss/git/fmf/fmf/base.py", line 634, in node
    tree = utils.fetch_tree(
  File "/home/psss/git/fmf/fmf/utils.py", line 653, in fetch_tree
    repository = fetch_repo(url, ref)
  File "/home/psss/git/fmf/fmf/utils.py", line 774, in fetch_repo
    raise FetchError("{0}".format(error), error)
fmf.utils.FetchError: Command 'git clone https://some.weird.url/ /home/psss/.cache/fmf/https:__some.weird.url_' returned non-zero exit status 128.

@adiosnb, interested to look into this?

@psss psss added command | import The import command command | plans tmt plans command labels Oct 27, 2022
@adiosnb adiosnb self-assigned this Nov 1, 2022
@adiosnb
Copy link
Collaborator

adiosnb commented Nov 1, 2022

Is this issue about gracefully skipping a plan with an invalid URL?

@lukaszachy
Copy link
Collaborator

I'd say correctly terminating run with a nice error message.

@adiosnb
Copy link
Collaborator

adiosnb commented Nov 3, 2022

The created patch creates the following output instead of a traceback. What do you think?

Error during fetching remote plan on git!
Command 'git clone https://some.weird.url/ /home/atomasov/.cache/fmf/https:__some.weird.url_' returned non-zero exit status 128.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command | import The import command command | plans tmt plans command
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants