-
Notifications
You must be signed in to change notification settings - Fork 21
Add a script to upload reports to GitHub #124
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
base: master
Are you sure you want to change the base?
Conversation
The Taskcluster secrets part should be in mozilla-releng/services, as we have code there to load the secrets. |
subprocess.run(['git', 'clone', 'https://github.com/coverage-crawler-updater/coverage-crawler-reports']) | ||
os.chdir('coverage-crawler-reports') | ||
|
||
# Remove the content of repository except of README |
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.
We can remove the README too, the repository will only be accessed from https://rhcu.github.io/coverage-crawler-reports/, so the README is unneeded.
coverage_crawler/github.py
Outdated
def upload_to_github(report_path, git_user_name, git_password): | ||
# Clone the repository if doesn't exist | ||
if not os.path.isdir('coverage-crawler-reports'): | ||
subprocess.run(['git', 'clone', 'https://github.com/coverage-crawler-updater/coverage-crawler-reports']) |
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.
We can clone the rhcu
repository directly.
https://rhcu.github.io/coverage-crawler-reports/ The index.html will look like this. |
Looks great! |
shutil.rmtree(f) | ||
elif f.startswith('.') is False: | ||
os.remove(f) | ||
subprocess.run(['git', 'pull', 'https://github.com/rhcu/coverage-crawler-reports', 'master']) |
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.
Instead of cloning and pulling, we can do like we do here: https://github.com/mozilla/release-services/blob/master/src/shipit_code_coverage/shipit_code_coverage/github.py#L74 and just always overwrite the contents of the repository.
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 basically:
- create a
coverage-crawler-reports
directory; - chdir to ^;
- run the crawler;
- create the index file;
- your current code from
git init
to the end.
You won't even need to move the reports this way, as they are created directly in the right directory.
Fixes #122
Need to add Taskcluster secrets and to clean up the code. WIll add this later.