Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Action Integration Test Issue #1

Closed
mokagio opened this issue Feb 7, 2020 · 10 comments
Closed

GitHub Action Integration Test Issue #1

mokagio opened this issue Feb 7, 2020 · 10 comments

Comments

@mokagio
Copy link
Owner

mokagio commented Feb 7, 2020

I'm working on integrating GitHub Actions, with the end goal of running all of the checks currently done with Peril with Actions + Danger, see wordpress-mobile#13366.

This issue will allow us to test the first integration experiment, annotating issues that don't have labels. The rule lives here.

Expect a lot of label/un-label activity here 😄 .

@mokagio
Copy link
Owner Author

mokagio commented Feb 7, 2020

Creating this issue didn't result in a workflow execution. I'm not surprised, the code is not on master develop yet.

@mokagio mokagio added the enhancement New feature or request label Feb 7, 2020
@mokagio
Copy link
Owner Author

mokagio commented Feb 7, 2020

Adding the label didn't trigger a workflow execution either. I was hoping it would because of the code is now in a PR, but I guess I need to merge it first.

Shame though, this will result in a lot of little merges on develop.

@mokagio mokagio removed the enhancement New feature or request label Feb 7, 2020
@mokagio
Copy link
Owner Author

mokagio commented Feb 7, 2020

Tried to remove the label with the PR no "Ready for review". Same result. Not surprising, but worth a shot.

@mokagio mokagio added the enhancement New feature or request label Feb 7, 2020
@mokagio
Copy link
Owner Author

mokagio commented Feb 7, 2020

Screen Shot 2020-02-07 at 11 41 00

Now we're talking 👍

@mokagio mokagio removed the enhancement New feature or request label Feb 7, 2020
@mokagio mokagio added the enhancement New feature or request label Feb 7, 2020
@mokagio
Copy link
Owner Author

mokagio commented Feb 7, 2020

The build kicked by adding this label failed with:

Unable to evaluate the Dangerfile
 TypeError: Cannot read property 'labels' of 
    at Object.<anonymous> (peril-downloaded-Automattic/peril-settings/org/issue/label.ts:96:48)
    at step (peril-downloaded-Automattic/peril-settings/org/issue/label.ts:76:27)
    at Object.next (peril-downloaded-Automattic/peril-settings/org/issue/label.ts:25:53)
    at peril-downloaded-Automattic/peril-settings/org/issue/label.ts:18:71
    at new Promise (<anonymous>)
    at __awaiter (peril-downloaded-Automattic/peril-settings/org/issue/label.ts:4:12)
    at Object.exports.default (peril-downloaded-Automattic/peril-settings/org/issue/label.ts:93:12)
    at Object.<anonymous> (/usr/src/danger/distribution/runner/runners/inline.js:147:60)
    at step (/usr/src/danger/distribution/runner/runners/inline.js:32:23)
    at Object.next (/usr/src/danger/distribution/runner/runners/inline.js:13:53)

"Cannot read property 'labels' of..." 🤔

I'm gonna remove the label to see what happens. I expect the build to fail again.

The fact that the labels property can't be read makes me wonder whether my token has the right access, or whether there's something that needs changing in the configuration.

Also... Why didn't the build fail for real? 🤔

@mokagio mokagio removed the enhancement New feature or request label Feb 7, 2020
@mokagio
Copy link
Owner Author

mokagio commented Feb 7, 2020

As expected, the build kicked by removing the label failed as well.

There's a better formatted error in the log than the one I pasted above:

Cannot read property 'labels' of undefined
TypeError: Cannot read property 'labels' of undefined
    at Object.<anonymous> (peril-downloaded-Automattic/peril-settings/org/issue/label.ts:96:48)
    at step (peril-downloaded-Automattic/peril-settings/org/issue/label.ts:76:27)
    at Object.next (peril-downloaded-Automattic/peril-settings/org/issue/label.ts:25:53)
    at peril-downloaded-Automattic/peril-settings/org/issue/label.ts:18:71
    at new Promise (<anonymous>)
    at __awaiter (peril-downloaded-Automattic/peril-settings/org/issue/label.ts:4:12)
    at Object.exports.default (peril-downloaded-Automattic/peril-settings/org/issue/label.ts:93:12)
    at Object.<anonymous> (/usr/src/danger/distribution/runner/runners/inline.js:147:60)
    at step (/usr/src/danger/distribution/runner/runners/inline.js:32:23)
    at Object.next (/usr/src/danger/distribution/runner/runners/inline.js:13:53)

The only line accessing labels is this

const githubLabels = danger.github.issue.labels;

My TypeScript is very poor, but from what I gather I'd say issue is what's undefined, otherwise the error would have been thrown earlier in the chaining.

This keeps pointing to my idea that the token doesn't have enough access. Maybe issue is undefined because it could not be read.

@mokagio
Copy link
Owner Author

mokagio commented Feb 7, 2020

The token has the recommended scope for a public repository:

Screen Shot 2020-02-07 at 12 37 35

Screen Shot 2020-02-07 at 12 46 36

Moreover, I can't find any scope mentioning issues in the GitHub docs.

@mokagio
Copy link
Owner Author

mokagio commented Feb 7, 2020

I've been trying to get faster feedback by running Danger locally, but it can only run on PRs not issues.

I might change the setup to run a rule for PRs, and go from there.

@mokagio
Copy link
Owner Author

mokagio commented Feb 17, 2020

I opened #23 with a proper setup. I'm going to add a label now to see if a workflow runs, but I doubt it will, we've seen already that the code needs to be on the base branch.

@mokagio mokagio added documentation Improvements or additions to documentation and removed documentation Improvements or additions to documentation labels Feb 17, 2020
@mokagio
Copy link
Owner Author

mokagio commented Feb 17, 2020

No workflow triggered.

I'm going to merge #23, then close this issue and open a new one to have a clean testing place.

@mokagio mokagio closed this as completed Feb 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant