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

Improve error message when Milestone does not exist in redmine. #428

Open
dkliban opened this issue Jun 30, 2021 · 2 comments
Open

Improve error message when Milestone does not exist in redmine. #428

dkliban opened this issue Jun 30, 2021 · 2 comments
Labels

Comments

@dkliban
Copy link
Member

dkliban commented Jun 30, 2021

Instead of producing a traceback like below, a proper error message should state "Couldn't find milestone x.y.z".

Repo path: /home/runner/work/pulp-certguard/pulp-certguard
Traceback (most recent call last):
  File ".github/workflows/scripts/release.py", line 61, in validate_and_update_redmine_data
    issue_milestone = redmine_issue.fixed_version
  File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/redminelib/resources/standard.py", line 152, in __getattr__
    return super(Issue, self).__getattr__(attr)
  File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/redminelib/resources/base.py", line 197, in __getattr__
    raise exceptions.ResourceAttrError
redminelib.exceptions.ResourceAttrError: Resource doesn't have the requested attribute

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".github/workflows/scripts/release.py", line 288, in <module>
    release_commit_sha = create_release_commits(repo, release_version, plugin_path)
  File ".github/workflows/scripts/release.py", line 132, in create_release_commits
    redmine_final_query, issues_to_close, release_version
  File ".github/workflows/scripts/release.py", line 66, in validate_and_update_redmine_data
    redmine.issue.update(redmine_issue.id, fixed_version_id=milestone.id)
UnboundLocalError: local variable 'milestone' referenced before assignment```
@daviddavis
Copy link
Contributor

It might be worth adding a check at the beginning of the release workflow and bailing if there's no milestone.

@stale
Copy link

stale bot commented May 24, 2022

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

@stale stale bot added the stale label May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants