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

Bug 1686039 - Migrate from travis to github actions #834

Merged
merged 50 commits into from Mar 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
4f8f098
Giant dependency bump
dependabot[bot] Mar 8, 2021
5710dbe
Bug 1686039 - Migrate from travis to github actions
wlach Mar 11, 2021
d865dd4
More stuff
wlach Mar 11, 2021
a8366e0
Linter updates
wlach Mar 11, 2021
64d614c
Updated glean documentation
wlach Mar 11, 2021
819d284
GUI label fixes
wlach Mar 11, 2021
8952c47
Install actual package
wlach Mar 11, 2021
b0f7f6e
More actions work
wlach Mar 11, 2021
d293555
Root
wlach Mar 11, 2021
55ac649
3.7+
wlach Mar 11, 2021
533129c
Hopefully fix gui tests
wlach Mar 11, 2021
7ec280e
Hmm
wlach Mar 11, 2021
f62c2f4
Force pyside2 test
wlach Mar 11, 2021
97968f1
Extra packages
wlach Mar 11, 2021
057a32d
Try again
wlach Mar 11, 2021
7fb167a
Debug
wlach Mar 11, 2021
d37a154
Another approach
wlach Mar 11, 2021
f8ecb5c
Another try
wlach Mar 11, 2021
d8e0624
debug plugins
wlach Mar 11, 2021
8305939
Use pytest-qt recommendations
wlach Mar 11, 2021
37afbe8
Prefs test
wlach Mar 11, 2021
abe1bdb
Run on both ubuntu and mac, I hope?
wlach Mar 23, 2021
d6a83a4
Try that again
wlach Mar 23, 2021
000f102
Another attempt
wlach Mar 23, 2021
10cc018
10.15
wlach Mar 23, 2021
24a6df8
lsb release
wlach Mar 23, 2021
caf23cc
Filesize
wlach Mar 23, 2021
068078e
the matrix has you
wlach Mar 23, 2021
d2c8931
Hopefully support old versions of mac
wlach Mar 23, 2021
3924438
Fix version
wlach Mar 23, 2021
28d0489
Adventures in paths
wlach Mar 23, 2021
0674fbf
Path take2
wlach Mar 23, 2021
a00cbde
Another try
wlach Mar 23, 2021
a49a4f2
Re-add pywin32 ctypes
wlach Mar 23, 2021
37051d6
Remove travis config
wlach Mar 23, 2021
c63a220
Another try for Windows
wlach Mar 23, 2021
0bf9143
Atomicwrites
wlach Mar 23, 2021
ec408f7
last minute tweaks
wlach Mar 23, 2021
45c7428
test all the versions
wlach Mar 23, 2021
1a040d7
python 3.6
wlach Mar 23, 2021
8dd2aab
dataclasses
wlach Mar 23, 2021
55ea2d0
Refactor requirements
wlach Mar 23, 2021
f8ff008
Refactor requirements
wlach Mar 23, 2021
933077a
iso8601
wlach Mar 23, 2021
7e9ab4a
Allow python 3.6 again
wlach Mar 23, 2021
a6f4464
Github token
wlach Mar 23, 2021
8968f56
More tweaks
wlach Mar 23, 2021
b97fa0a
GUI testing
wlach Mar 23, 2021
4fbdd6c
README tweak
wlach Mar 23, 2021
e6ad6e3
Review feedback and other tweaks
wlach Mar 25, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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