Giter Club home page Giter Club logo

libmozdata's Introduction

libmozdata

Library to access and aggregate several Mozilla data sources

The goal is to provide a library giving access to a wide range of Mozilla data sources. This library also provides some post processing on data.

Build Status codecov.io

Setup

Install the prerequisites via pip:

sudo pip install -r requirements.txt

Running tests

Install test prerequisites via pip:

sudo pip install -r test-requirements.txt

Run tests:

coverage run --source=libmozdata -m unittest discover tests/

Credentials

Copy the file mozdata.ini-TEMPLATE into mozdata.ini and fill the token entries.

Bugs

https://github.com/mozilla/libmozdata/issues/new

Contact

Email: [email protected] or [email protected]

libmozdata's People

Contributors

abpostelnicu avatar calixteman avatar dependabot-preview[bot] avatar evabardou avatar jankeromnes avatar jcristau avatar la0 avatar marco-c avatar mozilla-github-standards avatar nbp avatar peterbe avatar ralphsol avatar suhaibmujahid avatar sylvestre avatar willkg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libmozdata's Issues

Add support for Buildhub

Buildhub is the canonical source for product/version/build information:

https://mozilla-services.github.io/buildhub/

Much of what ProductVersions is doing should be done with Buildhub. ProductVersions is deprecated and slated to be removed soon.

If users want to access product/version/build information through libmozdata, then adding support for Buildhub seems prudent.

Enable Travis

Waiting to get back admin access to the repo and then I can enable Travis.

Test Bugzilla.put

We can do this easily without polluting bugzilla.mozilla.org by using the new class introduced in #46.

Switch to Taskcluster from Travis CI

We're opening this issue because your project has used Travis CI within the last 6 months. If you have already migrated off it, you can close and ignore this issue.

Travis CI is ending free builds on public repositories. travis-ci.com stopped providingthem in early November, and travis-ci.org will stop after December 31, 2020. To avoid disruptions to your workflows, you must migrate to another CI service.

For production use cases, we recommend switching to CircleCI. This service is already widely used within Mozilla. There is a guide to migrating from Travis CI to CircleCI available here.

For non production use cases, we recommend either CircleCI or Github Actions. There is a guide to migrating from Travis CI to Github Actions available here. Github Actions usage within Mozilla is new, and you will have to work with our github administrators to enable specific actions following this process.

If you have any questions, reach out in #github-admin:mozilla.org on matrix.

Wiki changes

FYI: The following changes were made to this repository's wiki:

These were made as the result of a recent automated defacement of publically writeable wikis.

Add comments_include_fields to patchanalysis

We only use a subset of the fields, we don't need to get them all from Bugzilla.

The fields are: bug_id, creator, raw_text, id, author, tags, text, is_private, time, creation_time, attachment_id.

Fix test_versions test

During the merge days, we might end up with the version for Aurora being the same for 'Beta'.

Traceback (most recent call last):

  File "/home/travis/build/mozilla/libmozdata/tests/test_versions.py", line 16, in test_versions

    self.assertTrue(v['esr'] <= v['release'] <= v['beta'] < v['aurora'] < v['nightly'])

AssertionError: False is not true

We should modify that assertion to always use <= instead of <.

parse_uplift_comment no longer recognizes uplift request comments

Root cause of mozilla/release-services#1698

Our upliftbot currently fails to process 100% of Bugzilla uplift request comments:

uplift_bot.sync: Failed to add bug #1411681 : Invalid response from post https://uplift.shipit.mozilla-releng.net/bugs : b'{"detail":"Missing uplift comment in analysis","instance":"about:blank","status":500,"title":"Missing uplift comment in analysis","type":"about:blank"}\n'

I suspect this is due to the recent change in uplift request comment templates.

Comments now look like this: https://bugzilla.mozilla.org/show_bug.cgi?id=1510281#c4

The first line includes the text [Beta/Release Uplift Approval Request] or [ESR Uplift Approval Request], depending on the request.

I can see that libmozdata still expects the text Approval Request Comment, which is no longer used:

uplift_pattern = re.compile('Approval Request Comment')

test_version.py is failing

ERROR: test_version_dates (test_versions.VersionsTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/mozilla/libmozdata/tests/test_versions.py", line 45, in test_version_dates
    self.assertTrue(versions.getMajorDate(v['release']) <= versions.getMajorDate(v['beta']))
TypeError: unorderable types: datetime.datetime() <= NoneType()

Make Bugzilla's chunk size configurable

When retrieving many fields, it makes sense to have 100 as the chunk size. When you are retrieving a subset of fields (e.g. only the ID), a larger chunk size would be better.

Redash failing because some in rows the 'build_version' column is completely missing

For example, for the beta channel on 2016-12-08.

    khours = Redash.get_khours(utils.get_date_ymd(start_date), utils.get_date_ymd(end_date), channel, versions, 'Firefox')
  File "/home/marco/Documenti/workspace/libmozdata/libmozdata/redash.py", line 132, in get_khours
    rows = Redash.__get_rows(channel, versions, rows)
  File "/home/marco/Documenti/workspace/libmozdata/libmozdata/redash.py", line 70, in __get_rows
    v = row['build_version']
KeyError: 'build_version'

Bugzilla queries can partially fail silently

bug_ids = # LIST OF 1500 BUGS    

Bugzilla.BUGZILLA_CHUNK_SIZE = 1000

bugs = {}

def bughandler(bug):
    bugs[bug["id"]] = bug["last_change_time"]

Bugzilla(
    bugids=bug_ids,
    bughandler=bughandler,
    include_fields=["id", "last_change_time"],
).get_data().wait()

print(len(bugs))

This snippets doesn't raise any error, but only 500 bugs are actually returned (as the first of the two chunked queries fails because the query URL is too long).

CODE_OF_CONDUCT.md file missing

As of January 1 2019, Mozilla requires that all GitHub projects include this CODE_OF_CONDUCT.md file in the project root. The file has two parts:

  1. Required Text - All text under the headings Community Participation Guidelines and How to Report, are required, and should not be altered.
  2. Optional Text - The Project Specific Etiquette heading provides a space to speak more specifically about ways people can work effectively and inclusively together. Some examples of those can be found on the Firefox Debugger project, and Common Voice. (The optional part is commented out in the raw template file, and will not be visible until you modify and uncomment that part.)

If you have any questions about this file, or Code of Conduct policies and procedures, please see Mozilla-GitHub-Standards or email [email protected].

(Message COC001)

Fix flake8 issues

There are some flake8 issues which we need to fix:

$ flake8 .
./libmozdata/connection.py:101:17: E722 do not use bare except'
./libmozdata/handler.py:74:9: E741 ambiguous variable name 'l'
./tests/test_config.py:25:9: E722 do not use bare except'
./tests/test_config.py:30:9: E722 do not use bare except'
./tests/test_config.py:35:9: E722 do not use bare except'
./tests/test_config.py:40:9: E722 do not use bare except'
./tests/test_config.py:45:9: E722 do not use bare except'
./tests/test_config.py:51:9: E722 do not use bare except'
./tests/test_config.py:56:9: E722 do not use bare except'

CC @calixteman

test_patchanalysis.py is failing

FAIL: test_bug_analysis (test_patchanalysis.PatchAnalysisTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "<string>", line 3, in wrapper
  File "/home/travis/build/mozilla/libmozdata/tests/test_patchanalysis.py", line 450, in test_bug_analysis
    self.assertEqual(info['landings']['esr'], datetime(2016, 4, 7, 18, 41, 3, tzinfo=pytz.UTC))
AssertionError: None != datetime.datetime(2016, 4, 7, 18, 41, 3, tzinfo=<UTC>)

Check for `config.ini` in several directories

Home directory first, then current working directory, etc..

We should rename the file obviously (libmozdata.ini maybe?), because we don't want to force users to put a config.ini file in their home directory.

Get rid of modules.json and use the artifact from the source-bugzilla-info task instead

The current modules.json file is 4 years old. It needs to be updated. I couldn't figure out how it was generated in the first place, so it's unclear how to update it. Further, this module should be updated on a regular basis.

How was modules.json generated?

Is there a better source for this information? Could it or something like it be generated from moz.build files in mozilla-central and parked somewhere?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.