googleapis / repo-automation-bots Goto Github PK
View Code? Open in Web Editor NEWA collection of bots, based on probot, for performing common maintenance tasks across the open-source repos managed by Google on GitHub.
License: Apache License 2.0
A collection of bots, based on probot, for performing common maintenance tasks across the open-source repos managed by Google on GitHub.
License: Apache License 2.0
The GitHub Apps we have created under dpebot all have the default github app logo. It would be nice to use the official Google 'G' for these :)
When mocking a 404 for context.config('filename')
, we need to do something like:
const requests = nock('https://api.github.com')
.get(
'/repos/<owner>/<repo>/contents/.github/release-please.yml'
)
.reply(404)
.get(
// why is this necessary?
'/repos/<owner>/.github/contents/.github/release-please.yml'
)
.reply(404);
release-please bot closed a PR that it did not open. The PR updated a dependency in the setup.py.
Create a Probot version of Startblock
As mentioned in comment at https://github.com/googleapis/repo-automation-bots/pull/114/files/f432c262d2344b20717c24357e1f71f2578c186e#diff-f8fbe6dc6a42af4c5efddeeeab43531bR34
We should add configuration file support to allow users to specify the trusted contributors.
A thing to also think about before implementing: would it be useful to restrict the file/filetype editable by each account? For instance, renovatebot should only ever need to edit package.json
files.
rather than updating our deploy scripts to stop replacing -
with _
let's update our bot's default import.
(when we started looking at taking on this work, it would have required that we update basically every bot that's deployed so far, and would have been a big pain).
see: #218
Our cloudbuild.yaml
uses a lot of complex bash. Let's pull the bash steps out into various scripts that can be tested and verified.
When developing and running tests (locally and on CI), tests can pass while deployment fails.
An example is the release-please
bot passed tests, but at deployment time, we discovered that it's missing @types/semver
.
We keep our samples for cloud.google.com and developers.google.com on the GitHub. I have several times broken samples, deleted region tags, or moved files in a way that cloudsite was unable to publish due to my changes. It would be awesome if I had a GitHub status check that told me when I was about to break things.
The devrel samples tracker should have much of the data we need :)
Provide a common set of labels (name and color) that can be enforced in all repositories across an organization.
See PR https://github.com/googleapis/nodejs-monitoring/pull/305/checks?check_run_id=245512794
Following View more details on License Header Lint GCF
link sends me to https://us-central1-repo-automation-bots.cloudfunctions.net/header_checker_lint which says 'Bad Request'.
This bot would look for branches used by PRs that have been merged to master, and delete them
Was trying to do some triage over here:
https://github.com/GoogleCloudPlatform/python-docs-samples/labels
Noticed that none of the api:
labels are getting automatically created for that repository. Not sure why :)
We've been moving our template towards license headers with a //
prefix rather than /*
, see: #184, we should update our bot generation script accordingly.
The framework (gcf-utils) currently silently discards errors.
Add Stackdriver logging and error reporting to the framework.
When there are changes to master, propose a new release.
For languages that support static analysis, identify breaking surface area changes and label the semver version change required to accept the PR.
The official style guide specifies that:
If e.g. one splits an existing file into several separate files, the copyright should say "2019-2020", but the current linter doesn't allow that. It can't parse the dash, and it wants to see the most recent year for added files.
For issues where we ask for more information and the opener never responds.
We'd like to be able to track our available quota and be notified if we are running low on requests. With added cron support, we are interested in our quota usage
it looks for configuration in .bots
currently.
renovate-bot has a feature to rebase/retry the PR which does a force push to its branch. This does not seem to trigger an event that the trusted-contributions bot listens to.
Is your feature request related to a problem? Please describe.
If 10 Go subtests of a single test all fail, you get 10 separate issues filed at the same time.
Describe the solution you'd like
Group subtests into a single issue. We could do this by splitting the test name on "/"
and only keying on the first part. Not sure how this would affect other languages.
Describe alternatives you've considered
Keep all of the issues separate. This is very noisy.
Additional context
https://github.com/GoogleCloudPlatform/golang-samples/issues?utf8=%E2%9C%93&q=is%3Aissue+%22bigquery%2Fsnippets%2Fquerying%3A+TestQueries%22+label%3A%22buildcop%3Aissue%22
We can parallelize the deployment of each bot to speed up deployment.
I was looking at this PR created by the release-please bot:
googleapis/sloth#328
And noticed that it didn't trigger a kokoro run. I'm not sure what Kokoro uses to decide if jobs should be run, but we should find a way to have PRs created by our bots automagically trigger CI if applicable.
Similarly to Cron Support; there are events from other services (e.g. Kokoro) whose job completion may trigger the invocation of a bot.
topic
file in their source foldertopic.repository
event in the appFn: app.on('topic.repository', async context => {});
topic
file and no corresponding PubSub topic it will
serverless-scheduler-proxy
instance. NOTE: This will use a custom ServiceAccount that has permissions to invoke the CloudRun instance./cron
(was /
)/pubsub
which handles incoming PubSub push messages of form:// PubSubMessage is the payload of a Pub/Sub event.
type PubSubMessage struct {
Message struct {
Data []byte `json:"data,omitempty"`
ID string `json:"id"`
} `json:"message"`
Subscription string `json:"subscription"`
}
Subscription
field, and creates a new HTTP request to the bot/Cloud Function whose name is in the subscription. This request will be signed using the signing key of the bot in the x-hub-signature
header, and the x-github-event
header will be topic.repository
Today, if you run the generate-bot and attempt to name a package with a hyphen ('-') it will fail.
✔ What is the name of the program? · trusted-contributions
✔ What is the description of the program? · blah
✔ This package will be saved in /packages/yourProgramName unless you specify another location and directory name here relative to /home/crwilcox/workspace/repo-automation-bots : · /package/trusted-contributions
You used an invalid character, like a hyphen or an integer. Please try again.
While not necessary, it is a convention we have used to this point. It would be great if we could extend the generator to support this.
Lock issue and PR threads that are closed, and days old.
Label untriaged issues with a "triage me" label.
Sample issue filed by build cop: GoogleCloudPlatform/python-docs-samples#2800
It seems that the source log link is only available once all testing is concluded, so it's a bit confusing when it files issues that can't be acted on immediately. In this case, its four hours later and the bug is still unactionable as the build is still in progress
Consider adding a link for another source (e.g. sponge/sponge2) or deferring issue creation until the artifacts are ready.
Hello! Autosynth couldn't regenerate repo-automation-bots. 💔
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.
Manage issues for failing unit tests.
Occasionally, we receive GitHub issues in non-English languages. This bot could comment on an issue or another comment with a translation if possible.
We're quickly realizing that we like cron an awful lot. Would be awesome to have a cron ability with the existing bot framework tied into cloud scheduler.
Ideally, we should not need esModuleInterop
configuration for tsconfig.
See https://github.com/googleapis/google-auth-library-nodejs/pull/867/checks?check_run_id=387631481
When a file (samples/iap.json
) was removed, the header lint check reports the file as having a missing header.
This bot is currently running on repositories without kokoro which is a bit awkard.
We can look if there is a .kokoro folder present and if so add the label instead of doing it just on contributor.
Provide a common set of configuration settings that can be shared across all repositories in an organization.
Example: googleapis/gcs-resumable-upload#256
This file has a string that matches the copyright header regex and is resulting in an incorrect failure.
Currently, you need to:
For folks who want to create a new bot, we should provide an easy mechanism to scaffold out a bot.
We've had a number of commits into the python-docs-samples repo recently from contributors who are not including tests. It'd be great if we had a bot that enforced coverage / tests for new code.
One approach could be to also use the nox --missingtests
functionality.
Due to the mono-repo nature of our project and our deployment pattern, there is no "baked in" way of forwarding errors that occur in a Bot to the given owners of a bot without subscribing to the "firehose" of all errors (like I have).
I propose that we create a serverless job that when an error occurs, it parses the bot the error occurred in, looks up who the OWNERS of the bot are via a code OWNERS file in this repository, then creates an issue assigned to those owners.
Extra credit would be to send an email to the owners in addition to the Issue, though that has other implications.
A problem I can see with this is accidentally including PII or other sensitive information in the created Issue. The body of the Issue may need to be ran through DLP before creating it, or we may need to have a "generic" body with a short stack trace to minimize this risk.
When an ‘automerge’ label is applied, after all required GitHub status checks pass, and the PR is approved, it will be automatically merged.
Step #0 - "build": src/header-checker-lint.ts:25:28 - error TS7016: Could not find a declaration file for module 'minimatch'. '/workspace/packages/header-checker-lint/node_modules/minimatch/minimatch.js' implicitly has an 'any' type.
Step #0 - "build": Try `npm install @types/minimatch` if it exists or add a new declaration (.d.ts) file containing `declare module 'minimatch';`
Step #0 - "build":
Step #0 - "build": 25 import * as minimatch from 'minimatch';
Step #0 - "build": ~~~~~~~~~~~
Not sure why it's passing CI, but failing here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.