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

[WIP] Refactor comparison #14

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

[WIP] Refactor comparison #14

wants to merge 5 commits into from

Conversation

bookwar
Copy link
Member

@bookwar bookwar commented Sep 28, 2020

Complete rewrite of the eln-check script

  • Create BuildSource object which might point to Koji tag or Brew tag
  • Create Comparison object, which stores data about comparison results
  • Render html, json and txt output via templates engine
  • Allow full comparison or comparison per package

* Create BuildSource object which might point to Koji tag or Brew tag
* Create Comparison object, which stores data about comparison results
* Render html, json and txt output via templates engine
* Allow full comparison or comparison per package
compare.py Outdated Show resolved Hide resolved
compare.py Outdated Show resolved Hide resolved
@jimbair
Copy link

jimbair commented Sep 28, 2020

Overall, it looks good to me; just a few suggestions listed above. :)

if source_id == "rhel":
# FIXME
infra = koji.ClientSession('https://brew')
tag = "rhel-9.0.0-alpha"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also added a condition here where source_id doesn't equal all these cases.
It will help to debug if something goes wrong.

Copy link
Contributor

@sturivny sturivny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to add some tests here ;)

"""
merged_packages = set()

distro_url = "https://tiny.distro.builders"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All those constant should be in a separate place.

else:
content = sorted(get_content())

C = Comparison(content, source1, source2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not the best name for the instance :)

between different distributions.
"""

epoch = "0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to create a separate variable here?
Couldn't find where it uses instead of return .


logging.debug("downloading {url}".format(url=url))

r = requests.get(url, allow_redirects=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, use try construction for requests.

"source2": "{{ source2 }}",
"stats": {{ stats|tojson }},
"packages": {{ results|tojson }}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a newline at the end of this file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants