mozilla-releng / mozilla-releng/scriptworker-scripts
[meta] refactor scripts to stop importing scriptworker, start importing scriptworker_client
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 16
- Fork
- 38
- Merge medio
- 1g 7h
- PR unite (30g)
- 14
Descrizione
Part of the rationale of having scriptworker call a script from the commandline, rather than import a python module and call a function, was to make the script independent of scriptworker. In theory this would:
- let us upgrade scriptworker without affecting scripts, as long as that commandline api stayed consistent,
- allow us to test scripts standalone, rather than requiring the worker,
- allow for a mixture of languages and python versions
(3) is currently no longer an issue. We've standardized on python 3. However, we still have the option of supporting other languages, especially if some other team wants to start using scriptworkers.
(2) has been theoretical, and still has some issues with user friendliness and discoverability. The testing iscript wiki page shows it's possible to test a script without scriptworker, especially when using the create_test_workdir script from scriptworker to populate the work_dir with a known task's task.json and CoT upstreamArtifacts.
The main thing we're solving here is (1). Because many scripts import scriptworker, upgrading scriptworker may still break those scripts, even if the commandline api stays consistent. Let's import scriptworker_client instead.
Doing so isn't just a simple drop-in replacement, however. scriptworker_client removes the usage of context objects, so this may be a sizeable patch set per script. But once we do this, we'll once more be able to upgrade scriptworker without fear of breaking the script, and we will be able to make all script-related changes in this repo rather than across two repos. (And the vocal opponents to the context objects will be appeased. :)
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia individuando gli script che importano scriptworker e confronta i loro punti di ingresso da riga di comando con quelli di scriptworker_client. Leggi la pagina wiki Testing iscript e le indicazioni su create_test_workdir per l’esecuzione standalone. Il lavoro è completato quando gli script non dipendono più dagli oggetti di contesto di scriptworker, preservando l’API da riga di comando.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- cli, tooling
- Tipo di issue
- Refactoring
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 30/100