pulp / pulp/plugin_template

Improve error message when Milestone does not exist in redmine.

Open
#428 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale
Dominant language
Python
Stars
10
Forks
40
Avg merge
21h 24m
Merged PRs (30d)
8

Description

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```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in .github/workflows/scripts/release.py, especially validate_and_update_redmine_data at lines 61-66, and read the traceback to understand the missing-milestone path. Confirm the behavior when redmine_issue.fixed_version is unavailable. Done means the script reports "Couldn't find milestone x.y.z" instead of producing the ResourceAttrError and UnboundLocalError traceback.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
release
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.