Giter Club home page Giter Club logo

sloth's Introduction

sloth

This is a simple utility for tracking SLOs of GitHub repositories.

sloth

Installation

Make sure you have node.js 8+ installed. Then do this:

$ npm install -g @justinbeckwith/sloth

Usage

You need to go create a personal access token in GitHub. Take this token, and save it as an environment variable named SLOTH_GITHUB_TOKEN.

$ sloth

Alternatively, you can just set it every time before running the tool:

$ SLOTH_GITHUB_TOKEN=****** sloth

CSV

You can also get output in CSV format! Just pass the --csv flag:

$ sloth --csv

That's it ๐ŸŽ‰ Enjoy!

sloth's People

Contributors

alexander-fenster avatar avaksman avatar bcoe avatar busunkim96 avatar chingor13 avatar coryan avatar crwilcox avatar danoscarmike avatar dependabot[bot] avatar devjgm avatar donmccasland avatar dwsupplee avatar fhinkel avatar gcf-owl-bot[bot] avatar jeanbza avatar jkwlui avatar justinbeckwith avatar kolea2 avatar meredithslota avatar parthea avatar release-please[bot] avatar renovate-bot avatar renovate[bot] avatar sduskis avatar sofisl avatar steffnay avatar tbpg avatar theacodes avatar tseaver avatar yoshi-automation avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sloth's Issues

Create new team for Cloud Trace

Is your feature request related to a problem? Please describe.
Cloud-trace team is taking over cloud-trace-nodejs agent, and trying to create a new team for us.

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: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Explicit "repos" field appears flaky in teams.json

In teams.json, there is an explicit repos field which allows a team to indicate repositories that they are tracking work on.

The repository GoogleCloudPlatform/cloud-sql-go-connector has been added to this field, however this repository is not be appropriately tracked by SLOs.

Update teams.json and repos.json for code-build-run team

We need to update teams.json and repos.json to reflect the new structure of the code-build-run team. We'll break out 3 new teams:

  • serverless: for cloud run, app engine, and other related products
  • operations: for cloud operations, observability, etc
  • devplat: for developer tools, anthos and gke

Missing info in README: DRIFT_API_KEY

After setting SLOTH_GITHUB_TOKEN, running sloth produces this:

$ sloth
/usr/local/lib/node_modules/@justinbeckwith/sloth/build/src/issue.js:23
    throw new Error('Please access the `Yoshi Drift Key` secret in go/valentine, and set the `DRIFT_API_KEY` env var.');
    ^

Error: Please access the `Yoshi Drift Key` secret in go/valentine, and set the `DRIFT_API_KEY` env var.
    at Object.<anonymous> (/usr/local/lib/node_modules/@justinbeckwith/sloth/build/src/issue.js:23:11)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/@justinbeckwith/sloth/build/src/slo.js:16:17)
    at Module._compile (module.js:652:30)

What is this for? If someone wanted to use sloth to monitor a different set of repos, could this be omitted?

Return language as an attribute of the repo

Currently:
sloth --csv

Repo,Total,P0,P1,P2,Untriaged,Out of SLO
google/google-api-dotnet-client,7,0,1,3,0,3
google/google-api-go-client,14,0,3,5,1,6

Desired:
sloth --csv

Repo,Lang,Total,P0,P1,P2,Untriaged,Out of SLO
google/google-api-dotnet-client,dotnet,7,0,1,3,0,3
google/google-api-go-client,go,14,0,3,5,1,6

delete users.json

Using a json file to manage our team membership was a great idea when we really cared about managing membership across 3 GitHub organizations. These days, most of our work is done in the googleapis organization. I'm creating this issue to track the removal of users.json so teams can be directly managed. A few details:

  • sync-repo-settings bot will still automatically assign the yoshi-<language> and yoshi-<language>-admins teams by convention to all appropriate language focused repos.
  • The yoshi-<language> and yoshi-<language>-admins teams will be moved out from the top level yoshi group, and will instead live on the top level
  • The users who currently live in the yoshi-<language>-admins group will have the maintainer bit on the yoshi-<language> teams

Synthesis failed for sloth

Hello! Autosynth couldn't regenerate sloth. ๐Ÿ’”

Here's the output from running synth.py:

Cloning into 'working_repo'...
Switched to branch 'autosynth'
Traceback (most recent call last):
  File "/home/kbuilder/.pyenv/versions/3.6.1/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/kbuilder/.pyenv/versions/3.6.1/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/tmpfs/src/git/autosynth/autosynth/synth.py", line 256, in <module>
    main()
  File "/tmpfs/src/git/autosynth/autosynth/synth.py", line 196, in main
    last_synth_commit_hash = get_last_metadata_commit(args.metadata_path)
  File "/tmpfs/src/git/autosynth/autosynth/synth.py", line 149, in get_last_metadata_commit
    text=True,
  File "/home/kbuilder/.pyenv/versions/3.6.1/lib/python3.6/subprocess.py", line 403, in run
    with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'text'

Google internal developers can see the full log here.

Team attribution evaluating repo rules before API

This commit here fixed one bug, and introduced another:
02b4a3b

For language focused teams like C++, this makes sense. We want the team to own the issue, and not the API owner.

The problem is the docs-samples repos :) In those cases, we want the API to be evaluated first, and then the repository.

Without thinking on it some more, I can't think of a way to satisfy both of these conditions without some real changes. For now - I would like to roll this change back and come up with a less disruptive plan.

Run `sloth tag-issues` as a kokoro job

As of today sloth runs on my personal k8s cluster, using a personal access token provisioned from my account. This is bad for so many reasons that I don't even have to list them ๐Ÿ˜†

I would like to make the running of sloth tag-issues an automated task that uses the yoshi-automation account. To set this up, we need:

  • An environment where nodejs 10 is installed (the node:10-alpine docker image is great)
  • The SLOTH_GITHUB_TOKEN environment variable must be set to a valid GitHub token
  • Run the command npx https://github.com/googleapis/sloth tag-issues
  • Do that every 3 minutes :)

Please do let me know if you have any concerns or questions!

Create contractor sub team and reduce team membership duplication

Proposal

Reduce number of duplicate entries of individuals across teams to make managing permissions more straightforward

  • Reduce Yoshi direct membership to a minimum number of people. Rely on sub teams to manage this
  • All repositories contain the yoshi team, so having all people in each language team is redundant
  • Create yoshi-contractors to migrate contractor team members off of parent yoshi team.
  • Remove contractors from individual language teams. The rights given via yoshi are sufficient.
  • Give Yoshi team write access to all repositories (some currently have read)
  • Enable master branch protection on all repositories
  • Create CODEOWNERS files for all repositories

Your .repo-metadata.json file has a problem ๐Ÿค’

You have a problem with your .repo-metadata.json file:

Result of scan ๐Ÿ“ˆ:

  • must have required property 'library_type' in .repo-metadata.json
  • must have required property 'release_level' in .repo-metadata.json

โ˜๏ธ Once you address these problems, you can close this issue.

Need help?

  • Schema definition: lists valid options for each field.
  • API index: for gRPC libraries api_shortname should match the subdomain of an API's hostName.
  • Reach out to go/github-automation if you have any questions.

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): update actions/setup-node action to v2
  • chore(deps): update codecov/codecov-action action to v2

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.


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

sloth does not know about the Auth team

Downstream tools use a naive filter to identify auth-related repos, resulting in duplicate reporting of OOSLO issues in Core and Auth.

We should define an 'auth' team in teams.json and assign appropriate repos (for Java, Go, Python) to that team.

Error: octokit.authenticate() is deprecated. Use "auth" constructor option instead

I was looking at the logs for the new sloth tag-issues kokoro job and noticed this in the logs.

Error: octokit.authenticate() is deprecated. Use "auth" constructor option instead.
    at authenticate (/home/node/.npm/_npx/9/lib/node_modules/@justinbeckwith/sloth/node_modules/@octokit/rest/plugins/authentication-deprecated/authenticate.js:4:16)
    at Object.<anonymous> (/home/node/.npm/_npx/9/lib/node_modules/@justinbeckwith/sloth/build/src/util.js:27:6)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/home/node/.npm/_npx/9/lib/node_modules/@justinbeckwith/sloth/build/src/issue.js:25:16)

Synthesis failed for sloth

Hello! Autosynth couldn't regenerate sloth. ๐Ÿ’”

Here's the output from running synth.py:

2020-05-14 06:37:10,235 autosynth [INFO] > logs will be written to: /tmpfs/src/github/synthtool/logs/googleapis/sloth
2020-05-14 06:37:10,238 synthtool [ERROR] > Failed executing git clone --single-branch https://github.com/googleapis/sloth.git /home/kbuilder/.cache/synthtool/sloth:

fatal: could not create work tree dir '/home/kbuilder/.cache/synthtool/sloth': No space left on device

Traceback (most recent call last):
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/tmpfs/src/github/synthtool/autosynth/synth.py", line 600, in <module>
    main()
  File "/tmpfs/src/github/synthtool/autosynth/synth.py", line 472, in main
    return _inner_main(temp_dir)
  File "/tmpfs/src/github/synthtool/autosynth/synth.py", line 519, in _inner_main
    working_repo_path = synthtool_git.clone(f"https://github.com/{args.repository}.git")
  File "/tmpfs/src/github/synthtool/synthtool/sources/git.py", line 83, in clone
    shell.run(cmd, check=True)
  File "/tmpfs/src/github/synthtool/synthtool/shell.py", line 39, in run
    raise exc
  File "/tmpfs/src/github/synthtool/synthtool/shell.py", line 33, in run
    encoding="utf-8",
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'clone', '--single-branch', 'https://github.com/googleapis/sloth.git', PosixPath('/home/kbuilder/.cache/synthtool/sloth')]' returned non-zero exit status 128.

Google internal developers can see the full log here.

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.