-
Notifications
You must be signed in to change notification settings - Fork 535
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
[Bug][Github] Extractor failing with draft release #8148
Comments
Hey @karl-d! I'm here to help you with any bugs, questions, or contributions you have for the project. I'll be your friendly bot while you wait for a human maintainer. Let's tackle this together! To address the issue with the GitHub extractor failing due to draft releases, you can modify the Extract: func(row *api.RawData) ([]interface{}, errors.Error) {
release := &GraphqlQueryRelease{}
err := errors.Convert(json.Unmarshal(row.Data, release))
if err != nil {
return nil, err
}
// Skip draft releases
if release.IsDraft {
return nil, nil
}
// Check for invalid 'PublishedAt' date
if release.PublishedAt == "0000-00-00" {
release.PublishedAt = nil // or set to a default valid date if necessary
}
var results []interface{}
githubRelease, err := convertGitHubRelease(release, data.Options.ConnectionId, data.Options.GithubId)
if err != nil {
return nil, errors.Convert(err)
}
results = append(results, githubRelease)
return results, nil
}, This modification ensures that draft releases are ignored and any invalid 'PublishedAt' dates are handled appropriately [1]. |
It should be an easy fix by modifying the following file: Would you like to try to do so? |
Draft releases lead to a bug described in GH Issue apache#8148
Draft releases lead to a bug described in GH Issue apache#8148
Draft releases lead to a bug described in GH Issue #8148
Draft releases lead to a bug described in GH Issue apache#8148
Search before asking
What happened
When running the pipeline against a github repo that contains a draft release it fails due to not having a incorrect datetime value for the published at column
What do you expect to happen
I would expect this to ignore the draft release.
How to reproduce
Create a draft PR in a repository, run the Collect Data and see the error on the github_graphql stage.
Anything else
We have this occur across a number of our projects where we use a GitHub Action to automatically draft a new PR for the next release.
Version
v1.0.1
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: