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
Improve error message for missing configuration #365
Comments
With joi we can add custom error messages to each and we can further parse the errors before logging. |
I was going to file this, but apparently it's filed here, so... #398 reported this problem but it doesn't appear that anyone improved the situation https://github.com/jsoref/jenkins/runs/501901399?check_suite_focus=true Action run logSkip to content
Search or jump to…
Pull requests
Issues
Marketplace
Explore
@jsoref
jsoref
/
jenkins
forked from jenkinsci/jenkins
1
06.1k
Code Pull requests 0 Actions Projects 0 Security Insights Settings
Merge pull request #4561 from daniel-beck/SECURITY-1754
master @timja 01baa2f
Changelog Drafter
on: push
Annotations: 1 failure
Changelog Drafter / update_draft_release
failed 11 hours ago in 1m 30s
Search logs
Set up job2s
Build release-drafter/release-drafter@v5.6.046s
Build jenkinsci/jenkins-core-changelog-generator@master39s
Generate GitHub Release Draft2s
##[error]Invalid config file
/usr/bin/docker run --name e87b52ab3426808d504150b634e20916f0c743_dcaa37 --label e87b52 --workdir /github/workspace --rm -e GITHUB_TOKEN -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -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 -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/jenkins/jenkins":"/github/workspace" e87b52:ab3426808d504150b634e20916f0c743
Deprecation: [@octokit/request-error] `error.code` is deprecated, use `error.status`.
at RequestError.get (/app/node_modules/@octokit/request/node_modules/@octokit/request-error/dist-node/index.js:29:17)
at loadYaml (/app/node_modules/probot-config/lib/index.js:51:11) {
name: 'Deprecation'
}
22:43:17.024Z WARN probot: jsoref/jenkins: Invalid config file
ValidationError: child "template" fails because ["template" is required]
at Object.exports.process (/app/node_modules/@hapi/joi/lib/errors.js:202:19)
at internals.Object._validateWithOptions (/app/node_modules/@hapi/joi/lib/types/any/index.js:763:31)
at internals.Object.validate (/app/node_modules/@hapi/joi/lib/types/any/index.js:797:21)
at validateSchema (/app/lib/schema.js:88:52)
at getConfig (/app/lib/config.js:23:20)
at async /app/index.js:11:20
22:43:17.034Z INFO probot:
jsoref/jenkins: Config validation errors, please fix the following issues in release-drafter.yml:
┌──────────┬────────────────────────┐
│ Property │ Error │
├──────────┼────────────────────────┤
│ template │ "template" is required │
└──────────┴────────────────────────┘
##[error]Invalid config file
Generate YAML changelog draft0s
Upload Changelog YAML0s
Complete job0s Popup output
Steps
Expected results
Technical improvements 22:43:17.024Z WARN probot: jsoref/jenkins: Invalid config file
- ValidationError: child "template" fails because ["template" is required]
+ ValidationError: child "template" failed because ["template" is required] -- while it's possible to think about things in the present continuous tense or future tense for testing, reporting to humans should be in the past tense. -- this appears to come from using an outdated version of - jsoref/jenkins: Config validation errors, please fix the following issues in release-drafter.yml:
- ┌──────────┬────────────────────────┐
- │ Property │ Error │
- ├──────────┼────────────────────────┤
- │ template │ "template" is required │
- └──────────┴────────────────────────┘
+ jsoref/jenkins: Config validation errors, please fix the following issues in https://github.com/jsoref/jenkins/blob/spell-checking/.github/release-drafter.yml:
+ configuration not found
+ see ... for more information |
In your default branch there needs to be a release-drafter.yml file looking at https://github.com/jsoref/jenkins you only have the workflow file. |
@jetersen: I'm not asking how to fix the problem. I'm asking the action to fix its error handling. Which is the issue behind this issue. My branch is for my use. I don't expect and shouldn't have to expect that my branch should be impinged by some other random branch. If some other random branch is missing a requirement, it should politely explain that to me instead of failing w/ a random incomprehensible error message. |
Remove action from the workflow? I am not sure I follow what exactly your issue is. |
Oh I see, you changed the default branch and because of how I suggest in your default branch add that single file to your default branch to make the action on the See https://github.com/probot/probot/blob/22d8215a631735f42c08b75ecc2657b7dcec2a54/src/context.ts#L189 Or revert the default branch to master. |
My action doesn't suffer from this. It might be how probot works, but it isn't how actions work in general. I've played w/ probot for a long time and have recently been working on my own action. There's nothing in the general GitHub action documentation that covers this. And again, it isn't a good usability feature to have this error behavior. The error reporting should at the very least be actionable by a human. They shouldn't have to search for bug reports to try to figure out the problem/fix. Nor should they have to search for the source code in a dependent library. Also, I can't change my default branch because I need to run a |
This was fixed in #973 |
Could be improved even more by using: https://github.com/probot/octokit-plugin-config/blob/a613c0efd2873fb64a3a87f79365ec1951fd29ad/src/index.ts#L13 directly, as we would be able to specify a branch to get the config from. Actually this function is even better as it will attempt to use |
Via #362
Currently we show the following when you're missing the Release Drafter config file:
11:13:07.934Z INFO probot: caicaishmily/actions_for_angular: No valid config found
We should update the message to be more actionable or link to the docs so that people can figure out how to solve the issue.
The text was updated successfully, but these errors were encountered: