-
Notifications
You must be signed in to change notification settings - Fork 739
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
Danger #6637
Danger #6637
Conversation
f268050
to
135df78
Compare
d820222
to
ebbef55
Compare
if: always() | ||
id: ktlint-results |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not necessary anymore, since Danger will post comments for each detected ktlint issue
For commit b0e019e It was because we had this comment: I do not know why this lint warning was reported, and not the 600+ other lint warnings. |
f86cc57
to
73b8460
Compare
path: | | ||
*/build/reports/ktlint/ktlint*/ktlint*.txt | ||
- name: Handle Results | ||
*/build/reports/**/*.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All reports are correctly exported, see https://github.com/vector-im/element-android/actions/runs/2753115871
So that Danger can report all errors from generated XML files
…since this is a warning. Also make this issue an error.
91fe6f9
to
fb67499
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it does the right things; I'm just a little concerned that https://github.com/vector-im/element-android/runs/7558101014?check_suite_focus=true#step:5:10 means we don't have the right accounts set up on it.
Found no issues or messages from Danger. Removing any existing messages on GitHub.
Could not add a commit status, the GitHub token for Danger does not have access rights.
If the build fails, then danger will use a failing exit code.
After merge would be good to see how 3rd party contributors see the requests - if they don't have the secret they might miss out on the danger report.
Kudos, SonarCloud Quality Gate passed! |
steps: | ||
- uses: actions/checkout@v3 | ||
- run: | | ||
npm install --save-dev @babel/plugin-transform-flow-strip-types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is @babel/plugin-transform-flow-strip-types
mandatory to run danger? I'm wondering if there's a local package.json/babel config we should apply this to as well 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, without this line, I got an error, see https://github.com/vector-im/element-android/runs/7524822865 :
Run danger/[email protected]
/usr/bin/docker run --name cd98fa901ef5630854d6b946f9faf39f02a4d_20631b --label 4cd98f --workdir /github/workspace --rm -e GITHUB_TOKEN -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/element-android/element-android":"/github/workspace" 4cd98f:a901ef5630854d6b946f9faf39f02a4d
Error: { Error: Cannot find module '@babel/plugin-transform-flow-strip-types' from '/github/workspace'
at Function.module.exports [as sync] (/usr/src/danger/node_modules/resolve/lib/sync.js:40:15)
at resolveStandardizedName (/usr/src/danger/node_modules/@babel/core/lib/config/files/plugins.js:101:31)
at resolvePlugin (/usr/src/danger/node_modules/@babel/core/lib/config/files/plugins.js:54:10)
at loadPlugin (/usr/src/danger/node_modules/@babel/core/lib/config/files/plugins.js:62:20)
at createDescriptor (/usr/src/danger/node_modules/@babel/core/lib/config/config-descriptors.js:154:9)
at items.map (/usr/src/danger/node_modules/@babel/core/lib/config/config-descriptors.js:109:50)
at Array.map (<anonymous>)
at createDescriptors (/usr/src/danger/node_modules/@babel/core/lib/config/config-descriptors.js:109:29)
at createPluginDescriptors (/usr/src/danger/node_modules/@babel/core/lib/config/config-descriptors.js:105:10)
at alias (/usr/src/danger/node_modules/@babel/core/lib/config/config-descriptors.js:63:49) code: 'MODULE_NOT_FOUND' }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this is more https://github.com/vector-im/element-android/runs/7526127685 :
Run danger/[email protected]
/usr/bin/docker run --name cd98fbc3b34cafe1d46bbabf9cc41d533b8f8_c74665 --label 4cd98f --workdir /github/workspace --rm -e GITHUB_TOKEN -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/element-android/element-android":"/github/workspace" 4cd98f:bc3b34cafe1d46bbabf9cc41d533b8f8
Error: Error: Cannot find module '@babel/plugin-transform-flow-strip-types'
Require stack:
- /usr/src/danger/node_modules/@babel/core/lib/config/files/plugins.js
- /usr/src/danger/node_modules/@babel/core/lib/config/files/index.js
- /usr/src/danger/node_modules/@babel/core/lib/index.js
- /usr/src/danger/distribution/runner/runners/utils/transpiler.js
- /usr/src/danger/distribution/runner/runners/inline.js
- /usr/src/danger/distribution/commands/danger-runner.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at resolve (internal/modules/cjs/helpers.js:107:19)
at resolveStandardizedName (/usr/src/danger/node_modules/@babel/core/lib/config/files/plugins.js:111:7)
at resolvePlugin (/usr/src/danger/node_modules/@babel/core/lib/config/files/plugins.js:55:10)
at loadPlugin (/usr/src/danger/node_modules/@babel/core/lib/config/files/plugins.js:63:20)
at loadPlugin.next (<anonymous>)
at createDescriptor (/usr/src/danger/node_modules/@babel/core/lib/config/config-descriptors.js:187:16)
at createDescriptor.next (<anonymous>)
at evaluateSync (/usr/src/danger/node_modules/gensync/index.js:251:28)
at /usr/src/danger/node_modules/gensync/index.js:31:34 {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/src/danger/node_modules/@babel/core/lib/config/files/plugins.js',
'/usr/src/danger/node_modules/@babel/core/lib/config/files/index.js',
'/usr/src/danger/node_modules/@babel/core/lib/index.js',
'/usr/src/danger/distribution/runner/runners/utils/transpiler.js',
'/usr/src/danger/distribution/runner/runners/inline.js',
'/usr/src/danger/distribution/commands/danger-runner.js'
]
}
To run danger locally, install it and run: | ||
|
||
```shell | ||
bundle exec danger pr <PR_URL> --dangerfile=./tools/danger/dangerfile.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worth mentioning that there's 2 implementations of danger, JS and Ruby, it looks like we're using the JS version in the github action but the Ruby version locally, this could introduce differences~
yarn danger pr <PR URL>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks for the heads up. I'll keep that in mind for the future 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great! no blockers from me 💯
Thanks for the review, let's merge the PR and see what we will get on other PRs! |
This PR add Danger to the project. Please refer to the documentation included in this PR (rendered) for more detail about the tool itself.
Other changes:
quality.xml has been updated, because all commands that generate XML report must be run before Danger can use them to generate PR comments.
Once merged, the list of required GitHub action will have to be updated on GitHub.
Check with main dangerfile
Example of comment made by this check:
Check with lint
Examples of comments (first error from ktlint, second error from Detekt):
And comment example from lint: