Git Product home page Git Product logo

tc-admin's Introduction


Taskcluster
Taskcluster

Inspecting a task on Taskcluster UI

The task execution framework that supports Mozilla's continuous integration and release processes.

Taskcluster Status License Chat netlify pre-commit


Usage

This repository is used to develop, build, and release the Taskcluster services.

Table of Contents

Team Mentions

Do you need to reach a specific subset of the team? Use the team handles to mention us with GitHub's @mention feature.

Team Name Use To...
@taskcluster/Core ping members of the Taskcluster team at Mozilla
@taskcluster/services-reviewers ping reviewers for changes to platform services and libraries
@taskcluster/frontend-reviewers ping people who can review changes to frontend (and related) code in the services monorepo
@taskcluster/security-folks ping people who do security things

Contributors

Thanks goes to these wonderful people (emoji key):

James Lal
James Lal

πŸ’» πŸ‘‹
Selena Deckelmann
Selena Deckelmann

πŸ’» πŸ‘‹
Dustin J. Mitchell
Dustin J. Mitchell

πŸ’» πŸ‘‹
Wander Lairson Costa
Wander Lairson Costa

πŸ’» πŸ‘‹
Greg Arndt
Greg Arndt

πŸ’» πŸ‘‹
Pete Moore
Pete Moore

πŸ’» πŸ”§
Hassan Ali
Hassan Ali

πŸ’» πŸ‘‹
John Whitlock
John Whitlock

πŸ’» πŸ‘‹
Brian Stack
Brian Stack

πŸ’» πŸ‘‹
John Ford
John Ford

πŸ’» πŸ‘‹
Eli Perelman
Eli Perelman

πŸ’» πŸ‘‹
Jonas Finnemann Jensen
Jonas Finnemann Jensen

πŸ’» πŸ‘‹
owlishDeveloper
owlishDeveloper

πŸ’» πŸ‘‹
Miles Crabill
Miles Crabill

πŸ’» πŸ‘‹
Chris Cooper
Chris Cooper

πŸ’» πŸ‘‹
Mathieu Leplatre
Mathieu Leplatre

πŸ’» πŸ‘‹
Rob Thijssen
Rob Thijssen

πŸ’»
Anup
Anup

πŸ’»
Hammad Akhtar
Hammad Akhtar

πŸ’»
Chinmay Kousik
Chinmay Kousik

πŸ’»
Anthony Miyaguchi
Anthony Miyaguchi

πŸ’»
Ana Rute Mendes
Ana Rute Mendes

πŸ’»
Andrea Del Rio
Andrea Del Rio

πŸ’»
kristelteng
kristelteng

πŸ’»
Elena Solomon
Elena Solomon

πŸ’»
Xavier L.
Xavier L.

πŸ’»
Yann Landry
Yann Landry

πŸ’»
Ayub
Ayub

πŸ’»
lteigrob
lteigrob

πŸ’»
Bastien Abadie
Bastien Abadie

πŸ’»
Amjad Mashaal
Amjad Mashaal

πŸ’»
Tom Prince
Tom Prince

πŸ’»
Samantha Yu
Samantha Yu

πŸ’»
Auni Ahsan
Auni Ahsan

πŸ’»
alex
alex

πŸ’»
Alisha Aneja
Alisha Aneja

πŸ’»
Prachi Manchanda
Prachi Manchanda

πŸ’»
Simon Fraser
Simon Fraser

πŸ’»
Yashvardhan Didwania
Yashvardhan Didwania

πŸ’»
Cynthia Pereira
Cynthia Pereira

πŸ’»
Hashini Galappaththi
Hashini Galappaththi

πŸ’»
Fienny Angelina
Fienny Angelina

πŸ’»
Kanika Saini
Kanika Saini

πŸ’»
Biboswan Roy
Biboswan Roy

πŸ’»
sudipt dabral
sudipt dabral

πŸ’»
Ojaswin
Ojaswin

πŸ’»
ΠœΠ°Ρ‚Ρ€Π΅ΡˆΠΊΠ°
ΠœΠ°Ρ‚Ρ€Π΅ΡˆΠΊΠ°

πŸ’»
Alok Kumar
Alok Kumar

πŸ’»
Arshad Kazmi
Arshad Kazmi

πŸ’»
Jason Yang
Jason Yang

πŸ’»
Shubham Gupta
Shubham Gupta

πŸ’»
Arun Kumar Mohan
Arun Kumar Mohan

πŸ’»
Brian Pitts
Brian Pitts

πŸ’»
E. Dunham
E. Dunham

πŸ’»
Shubham Chinda
Shubham Chinda

πŸ’»
Patrick Kang
Patrick Kang

πŸ’»
Rishabh Budhiraja
Rishabh Budhiraja

πŸ’»
ededals
ededals

πŸ’»
Ajin Kabeer
Ajin Kabeer

πŸ’»
Catherine Chepkurui
Catherine Chepkurui

πŸ’»
Jo
Jo

πŸ’»
vishakha
vishakha

πŸ’» πŸ“–
Noor Fatima
Noor Fatima

πŸ’»
Michael
Michael

πŸ’»
Mariana Zangrossi
Mariana Zangrossi

πŸ’»
ANURADHAJHA99
ANURADHAJHA99

πŸ’»
Edil
Edil

πŸ’»
Olympia
Olympia

πŸ’» πŸ“–
Michael Ozoemena
Michael Ozoemena

πŸ’»
lailahgrant
lailahgrant

πŸ’»
km-js
km-js

πŸ’»
Carolina Machado
Carolina Machado

πŸ’»
reenesa
reenesa

πŸ’»
Kelli Blalock
Kelli Blalock

πŸ’»
naima shaikh
naima shaikh

πŸ’»
Jiwoon Kim
Jiwoon Kim

πŸ’»
Michael Umanah
Michael Umanah

πŸ’»
Fahd Jamal A.
Fahd Jamal A.

πŸ“–
shilpi verma
shilpi verma

πŸ’»
somchi
somchi

πŸ’»
Anastasia
Anastasia

πŸ’»
Lubna
Lubna

πŸ’»
Soundharya AM
Soundharya AM

πŸ’»
Mustafa Jebara
Mustafa Jebara

πŸ’»
Aryaman Puri
Aryaman Puri

πŸ’»
Simon Sapin
Simon Sapin

πŸ’»
thoran
thoran

πŸ’»
Manish Giri
Manish Giri

πŸ’»
Tiger Oakes
Tiger Oakes

πŸ’»
Ricky Taylor
Ricky Taylor

πŸ’»
Alex Lopez
Alex Lopez

πŸ’»
Michelle
Michelle

πŸ› πŸš‡
Mrs. Velena
Mrs. Velena

πŸ’»
Ahmed A.
Ahmed A.

πŸ’»
Matt Boris
Matt Boris

πŸ’» πŸ”§
Yaraslau Kurmyza
Yaraslau Kurmyza

πŸ’» πŸ”§
Bastien Orivel
Bastien Orivel

πŸ’»
HamdiAmine
HamdiAmine

πŸ’»

This project follows the all-contributors specification. Contributions of any kind are welcome!

tc-admin's People

Contributors

ahal avatar bhearsum avatar bhushan-borole avatar djmitche avatar escapewindow avatar imbstack avatar jcristau avatar jwhitlock avatar la0 avatar lotas avatar matt-boris avatar mihaitabara avatar petemoore avatar renovate-bot avatar renovate[bot] avatar simonsapin avatar sudipt1999 avatar tomprince avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

tc-admin's Issues

Support "adding" scopes to roles

It's pretty common for a few different parts of the generation process to want to edit the same roles. This is especially common with user-related roles such as github-team:.... For example, a resouce generator for github projects might want to add github-related scopes to a role github-team:taskcluster/core, and another resource generator might want to add hook-related scopes to that same group.

Right now, handling this is tricky because a role can only be added to a Resources object once, so it's up to you to determine all of the required scopes before creating that resource.

Let's find a more convenient way to just "add" a scope to a role, creating that role if it doesn't already exist.

`tc-admin diff` traceback when the diff tool outputs `\ No newline at end of file`

This is probably due to the version of diff I'm using which is relatively new since I'm on archlinux. On tc-admin diff I'm getting the following:

  File "/home/eijebong/.local/lib/python3.10/site-packages/tcadmin/util/sessions.py", line 26, in wrap
    return await fn(*args, **kwargs)
  File "/home/eijebong/.local/lib/python3.10/site-packages/tcadmin/main.py", line 86, in diffCommand
    different = diff.show_diff(expected, actual)
  File "/home/eijebong/.local/lib/python3.10/site-packages/tcadmin/options.py", line 61, in wrap
    return fn(*args, **kwargs)
  File "/home/eijebong/.local/lib/python3.10/site-packages/tcadmin/diff.py", line 156, in show_diff
    result = textual_diff(generated, current, context)
  File "/home/eijebong/.local/lib/python3.10/site-packages/tcadmin/diff.py", line 132, in textual_diff
    return "\n".join(lines)
  File "/home/eijebong/.local/lib/python3.10/site-packages/tcadmin/diff.py", line 130, in <genexpr>
    colors[l[0]](l).rstrip() for l in (line if line else " " for line in lines)
KeyError: '\\'

A quick look shows that my diff tool outputs \ No newline at end of file.
Version of diff: /usr/bin/diff is owned by diffutils 3.8-1.

A quick workaround: Add "\\": lambda s: s, to

tc-admin/tcadmin/diff.py

Lines 121 to 126 in dd256bb

colors = {
"-": lambda s: t.red(strip_ansi(s)),
"+": lambda s: t.green(strip_ansi(s)),
"@": lambda s: t.yellow(strip_ansi(s)) + " " + contextualize(s),
" ": lambda s: s,
}

switch to pep8

Black is too opinionated, IMHO :)

Also, its definitions evolve and that seems to cause errors on PRs.

Is difflib’s algorithm bad?

tc-admin diff just produced unexpectedly large output. Here is one chunk of it:

@@ -421,34 +421,34 @@ WorkerPool=proj-servo/win2016-staging:
                       ],
                       "SubnetId": "subnet-036a0812d241733ef"
                   },
                   "region": "us-west-2",
                   "workerConfig": {
                       "genericWorker": {
                           "config": {
                               "checkForNewDeploymentEverySecs": 600,
-                              "deploymentId": "9a2aa17aa9128db5ee8c14878e668c800e4e1ccdb746fadbf58ea9e854b19e5a",
-                              "ed25519SigningKeyLocation": "C:\\generic-worker\\generic-worker-ed25519-signing-key.key",
-                              "idleTimeoutSecs": 14400,
-                              "livelogExecutable": "C:\\generic-worker\\livelog.exe",
-                              "sentryProject": "generic-worker",
-                              "shutdownMachineOnIdle": true,
-                              "taskclusterProxyExecutable": "C:\\generic-worker\\taskcluster-proxy.exe",
-                              "workerTypeMetadata": {},
-                              "wstAudience": "communitytc",
-                              "wstServerURL": "https://community-websocktunnel.services.mozilla.com"
-                          }
-                      }
-                  }
-              },
-              {
-                  "capacityPerInstance": 1,
-                  "launchConfig": {
-                      "ImageId": "ami-040db55391fa01dd7",
+                              "deploymentId": "6a4410a78638956b1b041e28563d7edab1fb3126700736915672aa35114538e3",
+                              "ed25519SigningKeyLocation": "C:\\generic-worker\\generic-worker-ed25519-signing-key.key",
+                              "idleTimeoutSecs": 14400,
+                              "livelogExecutable": "C:\\generic-worker\\livelog.exe",
+                              "sentryProject": "generic-worker",
+                              "shutdownMachineOnIdle": true,
+                              "taskclusterProxyExecutable": "C:\\generic-worker\\taskcluster-proxy.exe",
+                              "workerTypeMetadata": {},
+                              "wstAudience": "communitytc",
+                              "wstServerURL": "https://community-websocktunnel.services.mozilla.com"
+                          }
+                      }
+                  }
+              },
+              {
+                  "capacityPerInstance": 1,
+                  "launchConfig": {
+                      "ImageId": "ami-0707fecfddd0c8421",
                       "InstanceMarketOptions": {
                           "MarketType": "spot"
                       },
                       "InstanceType": "c5.xlarge",
                       "Placement": {
                           "AvailabilityZone": "us-west-2d"
                       },
                       "SecurityGroupIds": [

As far as I can tell, this is equivalent:

                       ],
                       "SubnetId": "subnet-036a0812d241733ef"
                   },
                   "region": "us-west-2",
                   "workerConfig": {
                       "genericWorker": {
                           "config": {
                               "checkForNewDeploymentEverySecs": 600,
-                              "deploymentId": "9a2aa17aa9128db5ee8c14878e668c800e4e1ccdb746fadbf58ea9e854b19e5a",
+                              "deploymentId": "6a4410a78638956b1b041e28563d7edab1fb3126700736915672aa35114538e3",
                               "ed25519SigningKeyLocation": "C:\\generic-worker\\generic-worker-ed25519-signing-key.key",
                               "idleTimeoutSecs": 14400,
                               "livelogExecutable": "C:\\generic-worker\\livelog.exe",
                               "sentryProject": "generic-worker",
                               "shutdownMachineOnIdle": true,
                               "taskclusterProxyExecutable": "C:\\generic-worker\\taskcluster-proxy.exe",
                               "workerTypeMetadata": {},
                               "wstAudience": "communitytc",
                               "wstServerURL": "https://community-websocktunnel.services.mozilla.com"
                           }
                       }
                   }
               },
               {
                   "capacityPerInstance": 1,
                   "launchConfig": {
-                      "ImageId": "ami-040db55391fa01dd7",
+                      "ImageId": "ami-0707fecfddd0c8421",
                       "InstanceMarketOptions": {
                           "MarketType": "spot"
                       },
                       "InstanceType": "c5.xlarge",
                       "Placement": {
                           "AvailabilityZone": "us-west-2d"
                       },
                       "SecurityGroupIds": [

… which I would much prefer to have. It looks like this output is produced by difflib, which unfortunately doesn’t have any parameter that tweaks the algorithm. Compare with git diff which has --indent-heuristic, --diff-algorithm={patience|minimal|histogram|myers}, etc.

Would it make sense to use something other than difflib?

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

pip_setup
setup.py
  • taskcluster ~=44.0.0
  • click >=8.0.0,<8.2
  • blessings ~=1.7
  • attrs >=21.4.0,<22.2
  • sortedcontainers ~=2.4.0
  • aiohttp ~=3.8.0
  • pytest >=7.0.0,<7.3
  • pyyaml ~=6.0
  • pytest-asyncio >=0.18.0,<0.21

  • Check this box to trigger a request for Renovate to run again on this repository

Allow customization of the description prefix

In

def description_converter(value):
"""Prepend *DO NOT EDIT* and a short explainer to the given value"""
if not value.startswith("*DO NOT EDIT*"):
value = DESCRIPTION_PREFIX + value
return value
we add a prefix to every description that basically says "don't edit this". We would like to allow users to customize this prefix in tc-admin.py, similar to how they can customize check_path:
check_path = attr.ib(type=str, init=False, default="checks")

Release with updated PyYAML dependency

The current release (v2.6.0) requires PyYAML ~= 5.3.1, which means 5.4 is not accepted. Because PyYAML 5.4 is a security release, there should be a tc-admin update released to include it.

TypeError: __init__() should return None, not 'coroutine'

$ TASKCLUSTER_ROOT_URL=https://community-tc.services.mozilla.com tc-admin apply
Fetching secrets with passwordstore
Secrets fetched
Traceback (most recent call last):
  File "/Users/pmoore/tc-admin/tc-admin-venv/bin/tc-admin", line 8, in <module>
    sys.exit(boot())
  File "/Users/pmoore/tc-admin/tc-admin-venv/lib/python3.6/site-packages/tcadmin/boot.py", line 65, in boot
    main(appconfig)
  File "/Users/pmoore/tc-admin/tc-admin-venv/lib/python3.6/site-packages/tcadmin/main.py", line 122, in main
    cmd()
  File "/Users/pmoore/tc-admin/tc-admin-venv/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/pmoore/tc-admin/tc-admin-venv/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/pmoore/tc-admin/tc-admin-venv/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/pmoore/tc-admin/tc-admin-venv/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/pmoore/tc-admin/tc-admin-venv/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/pmoore/tc-admin/tc-admin-venv/lib/python3.6/site-packages/tcadmin/main.py", line 29, in wrap
    return loop.run_until_complete(fn(*args, **kwargs))
  File "/Users/pmoore/miniconda3/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete
    return future.result()
  File "/Users/pmoore/tc-admin/tc-admin-venv/lib/python3.6/site-packages/tcadmin/util/sessions.py", line 26, in wrap
    return await fn(*args, **kwargs)
  File "/Users/pmoore/tc-admin/tc-admin-venv/lib/python3.6/site-packages/tcadmin/main.py", line 120, in applyCommand
    await apply.apply_changes(expected, actual)
  File "/Users/pmoore/tc-admin/tc-admin-venv/lib/python3.6/site-packages/tcadmin/apply.py", line 34, in apply_changes
    updater = await Updater()
TypeError: __init__() should return None, not 'coroutine'

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (pinDependencies)

Support callbacks on apply

The fuzzing-tc project needs to run some actions before or after changes have been applied with tc-admin:

  1. cancel running tasks in a worker pool if it will be modified
  2. trigger hooks once they are created / modified
  3. ... maybe more actions later ?

We could implement that around tc-admin, but i think it could also be done by adding some callbacks functionality in the apply workflow.

An external repository would add some declarations in its local tc-admin.py :

appconfig.callbacks.before_apply.add(clear_tasks, actions=["update", "delete"], resources=[WorkerPool])
appconfig.callbacks.after_apply.add(trigger_hooks, actions=["update", "create"], resources=[Hook])

Each callback function would then receive a list of filtered resources if any matches the actions & resources type filter during the apply execution.

The tcadmin/update.py file seem like the obvious choice to trigger those callbacks.

@djmitche Would you be OK with a PR for this behaviour ?

Support setting rootUrl based on command-line arguments

https://hg.mozilla.org/ci/ci-admin/file/tip/README.md sets the root URL based on --environment, meaning that TASKCLUSTER_ROOT_URL doesn't need to be set for the read-only case. Probably most uses of tc-admin will only talk to a single deployment, and may want to just hard-code the root URL.

Let's allow registration of a callback to execute when the command line has been parsed, but before anything has started running. And let's add a way to set the root URL, overriding the default get-it-from-the-environment behavior.

Support for loading configuration

Abstract out some of the ciconfig support for loading data used to generate resources, in the form of some utility classes capable of loading things from another repo or local files, and of parsing YAML and creating attrs-based objects.

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.