Skip to content

Commit

Permalink
Bug 1686039 - Migrate from travis to github actions (#834)
Browse files Browse the repository at this point in the history
This includes a very large number of related changes, as I upgraded the dependency list at the same time. Currently we do not handle releases, that's coming in a followup.
  • Loading branch information
wlach committed Mar 25, 2021
1 parent ddc2541 commit 687d811
Show file tree
Hide file tree
Showing 40 changed files with 1,208 additions and 1,157 deletions.
117 changes: 117 additions & 0 deletions .github/workflows/build.yml
@@ -0,0 +1,117 @@
name: Build

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
lint:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/linters.txt
pip install -e .
- name: Lint
run: |
./bin/lint-check.sh || (echo "Lint fix results:" && ./bin/lint-fix.sh && git diff && false)
bin/update-glean-documentation.sh
if [[ $(git diff docs/glean | head -c1 | wc -c) -ne 0 ]]; then echo "Unexpected glean changes! Please regenerate glean documentation via `./bin/update-glean-documentation.sh`." && false; fi
build-and-test-linux-base:
runs-on: ${{ matrix.os }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
strategy:
matrix:
os:
- ubuntu-18.04
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/build.txt
pip install -e .
- name: Test
run: |
coverage run -m pytest tests
pip install coveralls; coveralls
build-and-test-linux-gui:
runs-on: ubuntu-18.04
env:
DISPLAY: ":99.0"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: setup
run: |
sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/build.txt
pip install -e .
- name: Build
run: |
python gui/build.py bundle
ls -alh gui/mozregression-gui.tar.gz
- name: Test
run: |
coverage run -m pytest -v gui/tests
pip install coveralls; coveralls
build-and-test-mac-gui:
runs-on: macos-latest
env:
# We need the official Python, because the GA ones only support newer macOS versions
# The deployment target is picked up by the Python build tools automatically
PYTHON_VERSION: 3.9.1
MACOSX_DEPLOYMENT_TARGET: 10.13
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Get Python
run: curl https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macosx10.9.pkg -o "python.pkg"
- name: Install Python
# See: https://github.com/actions/virtual-environments/issues/1256#issuecomment-770270252
run: |
sudo installer -pkg python.pkg -target /
echo "/Library/Frameworks/Python.framework/Versions/3.9/bin" >> $GITHUB_PATH
which python3
python3 --version
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install -r requirements/build.txt
pip3 install -e .
- name: Build
run: |
python3 gui/build.py bundle
ls -alh gui/dist/mozregression-gui.dmg
- name: Test
run: |
coverage run -m pytest -v gui/tests
pip3 install coveralls; coveralls
86 changes: 0 additions & 86 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -56,7 +56,7 @@ On Windows:
```bash
virtualenv -p python venv
venv\Scripts\activate
pip install -r requirements\all.txt
pip install -r requirements\build.txt -r requirements\linters.txt
pip install -e .
```

Expand All @@ -65,7 +65,7 @@ On Linux/MacOS:
```bash
virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements/all.txt
pip install -r requirements/build.txt -r requirements/linters.txt
pip install -e .
```

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -12,7 +12,7 @@ install:
- "pip install virtualenv"
- "virtualenv ."
- "Scripts\\activate.bat"
- "pip install -r requirements\\all.txt"
- "pip install -r requirements\\build.txt"
- "pip install -e ."
test_script:
# bundle the application
Expand Down
2 changes: 1 addition & 1 deletion bin/lint-check.sh
Expand Up @@ -4,5 +4,5 @@ set -e

LINTER_FILES="$(dirname "$0")/../.linter-files"

cat $LINTER_FILES | xargs isort --check-only --recursive
cat $LINTER_FILES | xargs isort --check-only
cat $LINTER_FILES | xargs flake8
2 changes: 1 addition & 1 deletion bin/lint-fix.sh
Expand Up @@ -4,5 +4,5 @@ set -e

LINTER_FILES="$(dirname "$0")/../.linter-files"

cat $LINTER_FILES | xargs isort --recursive -y
cat $LINTER_FILES | xargs isort
cat $LINTER_FILES | xargs black
27 changes: 15 additions & 12 deletions docs/glean/metrics.md
@@ -1,14 +1,14 @@
<!-- AUTOGENERATED BY glean_parser. DO NOT EDIT. -->

# Metrics
This document enumerates the metrics collected by this project.

This document enumerates the metrics collected by this project using the [Glean SDK](https://mozilla.github.io/glean/book/index.html).
This project may depend on other projects which also collect metrics.
This means you might have to go searching through the dependency tree to get a full picture of everything collected by this project.

# Pings

- [usage](#usage)

- [usage](#usage)

## usage

Expand All @@ -25,17 +25,20 @@ This ping includes the [client id](https://mozilla.github.io/glean/book/user/pin

- <https://bugzilla.mozilla.org/show_bug.cgi?id=1581647>

The following metrics are added to the ping:
All Glean pings contain built-in metrics in the [`ping_info`](https://mozilla.github.io/glean/book/user/pings/index.html#the-ping_info-section) and [`client_info`](https://mozilla.github.io/glean/book/user/pings/index.html#the-client_info-section) sections.

In addition to those built-in metrics, the following metrics are added to the ping:

| Name | Type | Description | Data reviews | Extras | Expiration |
| --- | --- | --- | --- | --- | --- |
| usage.app |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |The name of the app being used (firefox, gve, etc.) |[1](https://bugzilla.mozilla.org/show_bug.cgi?id=1581647#c9)||never |
| usage.bad_date |[datetime](https://mozilla.github.io/glean/book/user/metrics/datetime.html) |The bad date parameter used in a bisection, if present and specified as a date |[1](https://bugzilla.mozilla.org/show_bug.cgi?id=1651401#c5)||never |
| usage.build_type |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |The build type being bisected (asan, debug, opt, pgo, shippable, ...) |[1](https://bugzilla.mozilla.org/show_bug.cgi?id=1651401#c5)||never |
| usage.good_date |[datetime](https://mozilla.github.io/glean/book/user/metrics/datetime.html) |The good date parameter used in a bisection, if present and specified as a date |[1](https://bugzilla.mozilla.org/show_bug.cgi?id=1651401#c5)||never |
| usage.launch_date |[datetime](https://mozilla.github.io/glean/book/user/metrics/datetime.html) |The launch parameter used when running a single build, if present and specified as a date |[1](https://bugzilla.mozilla.org/show_bug.cgi?id=1651401#c5)||never |
| usage.variant |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |The variant of mozregression used to perform the bisection (gui, console, mach, etc.) |[1](https://bugzilla.mozilla.org/show_bug.cgi?id=1581647#c9)||never |
| Name | Type | Description | Data reviews | Extras | Expiration | [Data Sensitivity](https://wiki.mozilla.org/Firefox/Data_Collection) |
| --- | --- | --- | --- | --- | --- | --- |
| usage.app |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |The name of the app being used (firefox, gve, etc.) |[Bug 1581647](https://bugzilla.mozilla.org/show_bug.cgi?id=1581647#c9)||never | |
| usage.bad_date |[datetime](https://mozilla.github.io/glean/book/user/metrics/datetime.html) |The bad date parameter used in a bisection, if present and specified as a date |[Bug 1651401](https://bugzilla.mozilla.org/show_bug.cgi?id=1651401#c5)||never | |
| usage.build_type |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |The build type being bisected (asan, debug, opt, pgo, shippable, ...) |[Bug 1651401](https://bugzilla.mozilla.org/show_bug.cgi?id=1651401#c5)||never | |
| usage.good_date |[datetime](https://mozilla.github.io/glean/book/user/metrics/datetime.html) |The good date parameter used in a bisection, if present and specified as a date |[Bug 1651401](https://bugzilla.mozilla.org/show_bug.cgi?id=1651401#c5)||never | |
| usage.launch_date |[datetime](https://mozilla.github.io/glean/book/user/metrics/datetime.html) |The launch parameter used when running a single build, if present and specified as a date |[Bug 1651401](https://bugzilla.mozilla.org/show_bug.cgi?id=1651401#c5)||never | |
| usage.variant |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |The variant of mozregression used to perform the bisection (gui, console, mach, etc.) |[Bug 1581647](https://bugzilla.mozilla.org/show_bug.cgi?id=1581647#c9)||never | |

Data categories are [defined here](https://wiki.mozilla.org/Firefox/Data_Collection).

<!-- AUTOGENERATED BY glean_parser. DO NOT EDIT. -->

7 changes: 6 additions & 1 deletion gui/build.py
Expand Up @@ -141,7 +141,12 @@ def do_bundle(options):
"mozregression GUI.app", os.path.join("mozregression-gui", "mozregression GUI.app")
)
call(
"hdiutil", "create", "mozregression-gui.dmg", "-srcfolder", "mozregression-gui", "-ov",
"hdiutil",
"create",
"mozregression-gui.dmg",
"-srcfolder",
"mozregression-gui",
"-ov",
)
else:
# seems like some qml stuff is also bundled on Linux
Expand Down
4 changes: 3 additions & 1 deletion gui/mozregui/addons_editor.py
Expand Up @@ -52,7 +52,9 @@ def __init__(self, parent=None):
@Slot()
def add_addon(self):
(fileNames, _) = QFileDialog.getOpenFileNames(
self, "Choose one or more addon files", filter="addon file (*.xpi)",
self,
"Choose one or more addon files",
filter="addon file (*.xpi)",
)
for fileName in fileNames:
self.list_model.add_addon(fileName)
Expand Down
4 changes: 3 additions & 1 deletion gui/mozregui/bisection.py
Expand Up @@ -167,7 +167,9 @@ def _evaluate(self):
# a skip.
if self.download_in_background and self.test_runner.verdict != "s":
self.index_promise = IndexPromise(
self.mid, self.bisection._download_next_builds, args=(self._persist_files,),
self.mid,
self.bisection._download_next_builds,
args=(self._persist_files,),
)
# run the build evaluation
self.bisection.evaluate(self.build_infos)
Expand Down
4 changes: 3 additions & 1 deletion gui/mozregui/pref_editor.py
Expand Up @@ -93,7 +93,9 @@ def add_pref(self):
@Slot()
def add_prefs_from_file(self):
(fileName, _) = QFileDialog.getOpenFileName(
self, "Choose a preference file", filter="pref file (*.json *.ini)",
self,
"Choose a preference file",
filter="pref file (*.json *.ini)",
)
if fileName:
self.pref_model.add_prefs_from_file(fileName)
Expand Down
6 changes: 5 additions & 1 deletion gui/mozregui/report.py
Expand Up @@ -63,7 +63,11 @@ def update_pushlogurl(self, bisection):
def status_text(self):
if "pushlog_url" not in self.data:
return ReportItem.status_text(self)
return "Bisecting on %s [%s - %s]" % (self.data["repo_name"], self.first, self.last,)
return "Bisecting on %s [%s - %s]" % (
self.data["repo_name"],
self.first,
self.last,
)


class StepItem(ReportItem):
Expand Down
4 changes: 2 additions & 2 deletions gui/mozregui/ui/global_prefs.ui
Expand Up @@ -20,7 +20,7 @@
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<widget class="QLabel" name="persist_directory_label">
<property name="toolTip">
<string>The directory in which downloaded files are to persist.</string>
</property>
Expand All @@ -33,7 +33,7 @@
<widget class="DirectorySelectWidget" name="persist" native="true"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<widget class="QLabel" name="size_limit_persist_label">
<property name="toolTip">
<string>Size limit of the persist directory, in GiB. 0 means no limit.</string>
</property>
Expand Down
5 changes: 4 additions & 1 deletion gui/mozregui/wizard.py
Expand Up @@ -309,7 +309,10 @@ def options(self):
class BisectionWizard(Wizard):
def __init__(self, parent=None):
Wizard.__init__(
self, "Bisection wizard", (IntroPage, ProfilePage, BuildSelectionPage), parent=parent,
self,
"Bisection wizard",
(IntroPage, ProfilePage, BuildSelectionPage),
parent=parent,
)


Expand Down
4 changes: 3 additions & 1 deletion gui/tests/test_addons_editor.py
Expand Up @@ -40,7 +40,9 @@ def test_add_addon(qtbot, addons_editor, addons_file):
dlg.getOpenFileNames.return_value = ([filePath], "addon file (*.xpi)")
qtbot.mouseClick(addons_editor.ui.add_addon, Qt.LeftButton)
dlg.getOpenFileNames.assert_called_once_with(
addons_editor, "Choose one or more addon files", filter="addon file (*.xpi)",
addons_editor,
"Choose one or more addon files",
filter="addon file (*.xpi)",
)

# check addons
Expand Down

0 comments on commit 687d811

Please sign in to comment.