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
Run bugzilla automation script on github actions #700
Conversation
.github/send_email.py
Outdated
|
|
||
| if __name__ == '__main__': | ||
| send_html_email( | ||
| "dkliban@redhat.com, ttereshc@redhat.com, rchan@redhat.com", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "dkliban@redhat.com, ttereshc@redhat.com, rchan@redhat.com", | |
| ["dkliban@redhat.com", "ttereshc@redhat.com", "rchan@redhat.com"], |
| if __name__ == '__main__': | ||
| send_html_email( | ||
| "dkliban@redhat.com, ttereshc@redhat.com, rchan@redhat.com", | ||
| "Pulp CI job failed", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the text based message, text only with \n allowed
.github/send_email.py
Outdated
| send_html_email( | ||
| "dkliban@redhat.com, ttereshc@redhat.com, rchan@redhat.com", | ||
| "Pulp CI job failed", | ||
| "Pulp CI job failed - https://github.com/pulp/pulp-ci/actions", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this allows html tags
| "Pulp CI job failed - https://github.com/pulp/pulp-ci/actions", | |
| "<h1>Pulp CI job failed</h1> - https://github.com/pulp/pulp-ci/actions", |
|
Thank you @rochacbruno |
| python-version: '3.7' | ||
| - name: Bugzilla automation script | ||
| env: | ||
| REDMINE_BUGZILLA_CONF: ${{ secrets.REDMINE_BUGZILLA_CONF }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need secret!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What format does this need to be in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
INI format:
The Redmine and Bugzilla credentials are expected from to be read from a
file in ini format. See the example below. The location of this file is set
by the REDMINE_BUGZILLA_CONF environment variable.
For example `export REDMINE_BUGZILLA_CONF=~/Documents/redmine_bugzilla.ini`
<SNIP>
[bugzilla]
username = XXXX
password = XXXX
[redmine]
key = XXXX
</SNIP>
https://github.com/pulp/pulp-ci/blob/master/ci/redmine_bugzilla.py#L25-L38
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The secret for the redmine key is REDMINE_API_KEY and it'll be BUGZILLA_USERNAME and BUGZILLA_PASSWORD for the bz credentials.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I've set BUGZILLA_API_KEY as a secret on this repo. They're disabling use of username+password in favor of api keys. You should be able to do this:
RHBugzilla(f"{BUGZILLA_URL}/xmlrpc.cgi", api_key=api_key)
https://pulp.plan.io/issues/6368
closes #6368