Giter Club home page Giter Club logo

taskcluster-github's Introduction

taskcluster-github's People

Contributors

bhearsum avatar ccooper avatar ckousik avatar dividehex avatar djmitche avatar eliperelman avatar fiennyangeln avatar garbas avatar gregarndt avatar grenade avatar helfi92 avatar imbstack avatar johanlorenzo avatar jonasfj avatar jugglinmike avatar kritisingh1 avatar ochameau avatar owlishdeveloper avatar petemoore avatar usize avatar walac avatar ydidwania avatar

Stargazers

 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

taskcluster-github's Issues

Allow a way to specify relative dates in .taskcluster.yml

I found a snippet of older code from the templating engine that was used for specifying after how long artifacts would expire:

artifacts:
  'public':
    type: 'directory'
    path: '/home/worker/artifacts/public'
    expires: '{{#from_now }}7 days{{/from_now}}'

however, this fails with:

Rejecting Schema: http://schemas.taskcluster.net/docker-worker/v1/payload.json#\nErrors:\n * data.artifacts['public'].expires should match format \"date-time\""

Apparently some sort of similar functionality needs to be added to the github parser to allow this type of expiry to be specified (for now, I'm dropping the expires option).

Intermittent: some token substitutions not working in a pull request

Compare these two tasks, generated from the same PR:

  1. https://queue.taskcluster.net/v1/task/ERiMtxoYSri-M0YWhMzBSA
  2. https://queue.taskcluster.net/v1/task/ICyhFSvWTFWYJfmTi15pKA

The tokens in the first task have been properly substituted, such that we have a valid task. The second task still contains the literal text {{ event.base.user.login }}.

The missing substitutions seem to be intermittent and happened about one time in six for me (at a guess).

I noticed that {{ event.base.user.login }} is a token which is replaced for a pull request, but not replaced for a push, so I wonder if there is a race condition, such that when a commit is pushed to a branch where there is an active pull request, sometimes the push event might win the race against the pull request event, and then the task is generated as if it was for a regular push rather than for a pull request. This is based on looking at the data in

function getPullRequestDetails(eventData) {
return {
'event.type': 'pull_request.' + eventData.action,
'event.base.repo.branch': eventData.pull_request.base.label.split(':')[1],
'event.pullNumber': eventData.number,
'event.base.user.login': eventData.pull_request.base.user.login,
'event.base.repo.url': eventData.pull_request.base.repo.clone_url,
'event.base.sha': eventData.pull_request.base.sha,
'event.base.ref': eventData.pull_request.base.ref,
'event.head.user.login': eventData.pull_request.head.user.login,
'event.head.repo.url': eventData.pull_request.head.repo.clone_url,
'event.head.repo.branch': eventData.pull_request.head.label.split(':')[1],
'event.head.sha': eventData.pull_request.head.sha,
'event.head.ref': eventData.pull_request.head.ref,
};
};
function getPushDetails(eventData) {
let ref = eventData.ref;
// parsing the ref refs/heads/<branch-name> is the most reliable way
// to get a branch name
let branch = ref.split('/').slice(2).join('/');
return {
'event.type': 'push',
'event.base.repo.branch': branch,
'event.head.repo.branch': branch,
'event.head.user.login': eventData.sender.login,
'event.head.repo.url': eventData.repository.clone_url,
'event.head.sha': eventData.after,
'event.head.ref': ref,
'event.base.sha': eventData.before,
};
};
and also remembering that when using travis-ci.org, two builds would get triggered on a PR - and joining the dots and suspecting that the reason for this is also that a push to a PR results in both events getting fired.

CC @djmitche @imbstack @owlishDeveloper

taskcluster-github adds browser history item when it rewrites URL to add trailing slash

The URL that taskcluster-github uses for task-graph-inspector links (f.e. the status icon link and the "Details" link in a pull request) contains no trailing slash, f.e.:

https://tools.taskcluster.net/task-graph-inspector/#Rjr993ErSe6LRpv3O-rS5A

But when you follow that link, the URL gets changed to a version that contains a trailing slash, f.e.:

https://tools.taskcluster.net/task-graph-inspector/#Rjr993ErSe6LRpv3O-rS5A/

Unfortunately, the change happens in a way that adds a history item to the browser's history for the tab. So if you then press the browser "Back" button, you go "back" to the same page, but without the trailing slash on the URL. And you have to press "Back" again to get back to the page you were on before.

If it's necessary to add the slash, it should happen in a way that doesn't add an item to the browser's history.

If scopes are wrong, we don't create a status and don't create a build entry.

Which creates one of these and silently fails on github.

https://sentry.io/taskcluster/taskcluster-github/issues/200755273/

ResourceNotFoundError: The specified resource does not exist.
RequestId:32fd1c27-0002-000d-21fe-8155cf000000
Time:2017-02-08T11:27:56.4469691Z
  File "/app/node_modules/fast-azure-storage/lib/table.js", line 482, in null.<anonymous>
    var err         = new Error(message);
  File "/app/node_modules/promise/lib/core.js", line 37, in tryCallOne
    return fn(a);
  File "/app/node_modules/promise/lib/core.js", line 123, in null.<anonymous>
    var ret = tryCallOne(cb, self._65);
  File "/app/node_modules/asap/raw.js", line 50, in flush
    queue[currentIndex].call();
  File "internal/process/next_tick.js", line 67, in _combinedTickCallback
...
(1 additional frame(s) were not displayed)

ResourceNotFoundError: The specified resource does not exist.
RequestId:32fd1c27-0002-000d-21fe-8155cf000000
Time:2017-02-08T11:27:56.4469691Z

TypeError: Cannot read property 'name' of null (eventData.pull_request.head.repo.name)

https://sentry.io/taskcluster/taskcluster-github/issues/208036664/

TypeError: Cannot read property 'name' of null
  File "/app/lib/api.js", line 46, in getPullRequestDetails
    'event.head.repo.name': eventData.pull_request.head.repo.name,
  File "/app/lib/api.js", line 223, in Object._callee$
    msg.details = getPullRequestDetails(body);
  File "/app/lib/api.js", line 303, in Object.<anonymous>
    return _ref.apply(this, arguments);
...
(11 additional frame(s) were not displayed)

TypeError: Cannot read property 'name' of null

EntityAlreadyExistsError when uninstalling and re-installing the integration on a repo

https://sentry.io/taskcluster/tc-github-staging/issues/222628365/

EntityAlreadyExistsError: The specified entity already exists.
RequestId:de8a0085-0002-00bc-2190-8c71f4000000
Time:2017-02-21T22:22:00.6435068Z
  File "/app/node_modules/fast-azure-storage/lib/table.js", line 482, in null.<anonymous>
    var err         = new Error(message);
  File "/app/node_modules/promise/lib/core.js", line 37, in tryCallOne
    return fn(a);
  File "/app/node_modules/promise/lib/core.js", line 123, in null.<anonymous>
    var ret = tryCallOne(cb, self._65);
  File "/app/node_modules/asap/raw.js", line 50, in flush
    queue[currentIndex].call();
  File "internal/process/next_tick.js", line 67, in _combinedTickCallback
...
(1 additional frame(s) were not displayed)

EntityAlreadyExistsError: The specified entity already exists.
RequestId:de8a0085-0002-00bc-2190-8c71f4000000
Time:2017-02-21T22:22:00.6435068Z

badly formatted .taskcluster.yml should be handled

Currently, we'll get a warning in papertrail, like:

 Tue, 17 Jan 2017 18:09:46 GMT taskcluster-github error (reported to sentry) while calling job handler: YAMLException: bad indentation of a sequence entry at line 83, column 39: 

Instead we should probably post a message to PR / commit to say that the .taskcluster.yml is malformed, and mark it as a failure. Currently, you just don't get a message e.g. in the PR so you don't know if the format was bad, or if the service is down.

CC: @owlishDeveloper @imbstack @djmitche

Convert sanitized repository names back to having '.' in them before trying to access them

In the endpoint that receives the webhook from github, we remove certain characters from certain fields. I'm not sure why this is yet (I'm guessing maybe pulse wants the routing key to have no '.'?) but I don't see where we're converting back inside the worker in order to call out to the github api. I don't think (also not confirmed) that github understands science%mozilla%org to mean science.mozilla.org. I think this might cause us to not be able to run repositories with '.' in them, but not confirmed quite yet.

Reruns don't change status check result

Sometimes we end up with infrastructure failures as part of PR checks. These are usually fixable by rerunning the Task, but doing so doesn't change the status on Github. For example, mozilla-releng/balrog#515 had one failing Task (https://tools.taskcluster.net/groups/RxbsRtsYTmu_PeOQK58DHQ/tasks/RxbsRtsYTmu_PeOQK58DHQ/runs/0), which I reran. The Task (and Group) are green now, but the status check is still showing a failure. (For posterity, here's a screenshot of both: https://hearsum.ca/~bhearsum/2ad3488b.png)

This is particularly inconvenient when Taskcluster is a required status check -- patches cannot be merged without changing something on the branch to get an entirely new commit + CI.

Figure out a way to make bots able to run tc jobs on push/PR

Currently when the greenkeeper bot pushes a branch and makes a PR on any of our repositories that are managed that way, tc-github gives a 403 claiming Bad Signature. I have a hunch that this is because tc-github doesn't know that we've allowed greenkeeper to be doing this sort of thing. I need to investigate further, but presumably there's a way we can figure out that the org has given permissions to the bot and therefore allow it to run builds on pushes/PRs.

commit on PR branch triggers task graph run using original .taskcluster.yml

Over in mozilla/positron#121, I've been improving Positron's .taskcluster.yml file via a series of incremental changes. And until recently, each time I've pushed a change, TaskCluster has used the new .taskcluster.yml file to configure a task graph run.

But the most recent change, mozilla/positron@46799e7, triggered a task graph run that appears to be using the original, unmodified .taskcluster.yml rather than the one on the branch.

Strangely, the most recent change also triggered two runs:

Note: I'm using a branch in the upstream repository (https://github.com/mozilla/positron) rather than one in my fork (https://github.com/mykmelez/positron) because of this "note on testing" on TaskCluster GitHub:

TaskCluster GitHub will not use .taskcluster.yml files from pull requests. To test .taskcluster.yml changes create a new branch on the master/base repository and open pull requests against it or make pushes to it (depending on the events you have enabled).

Based on that note, I would expect TaskCluster to do what it has been doing until the most recent change: use the revised .taskcluster.yml file in the branch, since the branch is on the master/base repository.

status links on commits page have gone away

I have a ticket open with github support now over the case of the disappearing status links on branch commit pages. We have a sorta-workaround now:

11:56:22 <gerard-majax> how am I supposed to get link to taskcluster in the mean time?
11:56:29 <bstack> I'll open a bug on github to reference
11:56:33 <bstack> which repo?
11:56:35 <bstack> and branch?
11:56:42 <gerard-majax> deepspeech
11:57:03 <gerard-majax> https://github.com/mozilla/tensorflow/tree/v1.0.0-warpctc
11:59:17 <bstack> So here is every build we've done for tensorflow: https://github.taskcluster.net/v1/builds?organization=mozilla&repository=tensorflow and https://github.taskcluster.net/v1/repository/mozilla/tensorflow/v1.0.0-warpctc/latest is a link to the latest build on that branch
11:59:47 <bstack> https://github.taskcluster.net/v1/repository/mozilla/tensorflow/v1.0.0-warpctc/badge.svg will get you a badge for your readme as well if you'd like :p
12:00:05 <&garndt> hah I like that badge
12:00:13 <bstack> url hacking should let you use those links for any repo you like until we get word back from github

Error: {"message": "No server is currently available to service your request. Sorry about that. Please t...

Not sure if we should figure out a way to handle this with retries or not. Leaving this for now.

https://sentry.io/taskcluster/taskcluster-github/issues/204412157/

Error: {"message": "No server is currently available to service your request. Sorry about that. Please try resubmitting your request and contact us if the problem persists."}

Error: {"message": "No server is currently available to service your request. Sorry about that. Please try resubmitting your request and contact us if the problem persists."}

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.