Closed Bug 1228483 Opened 9 years ago Closed 9 years ago

deploy failing: No module named mozautomation.commitparser

Categories

(MozReview Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: glob, Assigned: glob)

References

Details

Attachments

(1 file)

bug 1220232 added a dependency on mozautomation to reviewboard:
https://hg.mozilla.org/hgcustom/version-control-tools/rev/c94a76673d3c

it looks like these changes aren't enough to fix deployment:

  File "/data/www/reviewboard-dev.allizom.org/version-control-tools/pylib/mozreview/mozreview/resources/commit_rewrite.py", line 17, in <module>
    from mozautomation.commitparser import (replace_reviewers,)
ImportError: No module named mozautomation.commitparser

i'm not sure, but i suspect the fix for this is to add mozautomation to ansible/tasks/install-mozreview.yml
mozreview: build mozautomation egg when installing mozreview (bug 1228483) r?smacleod

As mozreview has a dependency on mozautoation, mozautomation needs to be build
before mozreview.
Attachment #8692792 - Flags: review?(smacleod)
sorry; i haven't been able to test the changes in that patch.
Assignee: nobody → glob
https://reviewboard.mozilla.org/r/26327/#review23941

::: ansible/tasks/install-mozreview.yml:18
(Diff revision 1)
> +- name: build mozautomation egg
> +  command: "{{ python }} setup.py bdist_egg chdir={{ rb_vct }}/pylib/mozautomation"
> +
> +- name: install mozautomation egg
> +  shell: "{{ easy_install }} -U dist/*.egg chdir={{ rb_vct }}/pylib/mozautomation"

Quick Python packaging history lesson.

Eggs are an old, mostly deprecated archive/distribution format for Python packages. They are nearly extinct. But Review Board relies on a property of them that hasn't been carried forward to the new world order.

easy_install is also a legacy tool for installing Python packages. pip is what should be used for most installs. Again, the easy_install usage here is related to Review Board legacy requirements.

These 2 lines can be consolidated into a single:

{{ venv }}/bin/pip install --upgrade --no-deps --force-reinstall {{ rb_vct }}/pylib/mozautomation

You typically don't need all those arguments. But local installs that overwrite existing installs of the same reported package version need extra foo. --no-deps ensures we don't pull in 3rd party dependencies. The reason we do this is because 3rd party dependencies should be installed through requirements.txt files, which pin the SHA-256 of the downloaded package to ensure there is no tampering or unnoticed changes.
Attachment #8692792 - Flags: review?(smacleod)
Comment on attachment 8692792 [details]
MozReview Request: mozreview: install mozautomation when installing mozreview (bug 1228483) r?smacleod

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/26327/diff/1-2/
Attachment #8692792 - Attachment description: MozReview Request: mozreview: build mozautomation egg when installing mozreview (bug 1228483) r?smacleod → MozReview Request: mozreview: install mozautomation when installing mozreview (bug 1228483) r?smacleod
Attachment #8692792 - Flags: review?(smacleod)
Blocks: 1220214
Comment on attachment 8692792 [details]
MozReview Request: mozreview: install mozautomation when installing mozreview (bug 1228483) r?smacleod

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/26327/diff/2-3/
Attachment #8692792 - Flags: review?(smacleod) → review?(gps)
Attachment #8692792 - Flags: review?(gps) → review+
Comment on attachment 8692792 [details]
MozReview Request: mozreview: install mozautomation when installing mozreview (bug 1228483) r?smacleod

https://reviewboard.mozilla.org/r/26327/#review24181

::: ansible/tasks/install-mozreview.yml:19
(Diff revision 2)
> +  shell: "{{ venv }}/bin/pip install --upgrade --no-deps --force-reinstall {{ rb_vct }}/pylib/mozautomation"

Does `command` not work? It should.
https://hg.mozilla.org/hgcustom/version-control-tools/rev/4918f6af176f

and pushed to dev:

PLAY RECAP ********************************************************************
reviewboard1.dev.webapp.scl3.mozilla.com : ok=30   changed=18   unreachable=0    failed=0
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Product: Developer Services → MozReview
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: