github: Invalid GQL Query in `buildAssociatedPRsQuery` when commits/shas empty
During the upgrade to v10.0.7 which introduced GraphQL to the success lifecycle method, we’ve noticed an increase in errors in our CI pipeline and have narrowed it down to an invalid GQL Query in buildAssociatedPRsQuery as a result of the shas variable being empty (context.commits).
This may be specific to our workflow with an additional plugin, however we have the ability to force semantic release to publish a new version, which results in context.commits being empty and therefore a GQL query gets generated as below:
#graphql
query getAssociatedPRs($owner: String!, $repo: String!) {
repository(owner: $owner, name: $repo) {
}
}
Resulting in:
11:56:33 GraphqlResponseError: Request failed due to following response errors:
11:56:33 - Parse error on "}" (RCURLY) at [5, 7]
It would be nice if the changes made in be394cfb9190b9cb8961e7a9155f39eb00cbde8b would handle empty context.commits as per the previous implementation.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 18 (9 by maintainers)
@babblebey can you please have a look?
I think this is already handled, we didn’t overlook for sure, In the cases where the
successComment: false(as @AlexC stated they’ve just stated in their config), no action to search for associated PR and respective issues is performed for sure.As seen here https://github.com/semantic-release/github/blob/master/lib%2Fsuccess.js#L57-L59
I guess the reason why this because a blocker was because the
successCommentis default totruehence the emptycontext.commitmade it through.A suggestion to address this permanently could be that we’d accompany the check with the
context.commitemptiness check too 🤔I assume this should bring that backward compatibilty for @zachspar too 🤔
thanks for the additional detail. it is helpful to understand that you are running into the problem when processing commits as normal. i do think semantic-release-monorepo inspects the commits a bit differently than we normally do because it filters based on the file structure that each package is within the overall repository. i’m not super familiar with the implementation of semantic-release-monorepo, so it sounds like we’ll need to understand how those are handled that might be different in that case. it might be helpful to open an issue within the semantic-release-monorepo repository as well, since we arent the support team for that extension and there might be better insight there.
based on the usage that you describe, i’m not confident yet that “unintended” necessarily applies here. that is what we are still trying to understand. it is still possible that we have a gap in our test coverage that could be improved for a supported use case.
this reference is appreciated. is it possible to also link to your usage? is it a public repository too?
we are very careful to mark breakages of supported features to our public interface as breaking. it is always possible that we make a mistake and need to revert a release and re-release as breaking, but we need to determine if there was actually a breakage before we know how we should proceed. i disagree that unintended features fall into this category, however. using a private api, for example, provides no guarantees that our changes will not result in a breakage.
we do not provide official support for monorepos, but we also want to enable community supported extensions, like semantic-release-monorepo to add support on top of our base. we need to understand more about the use case to determine if it is reasonable to handle such use cases.
this sounds potentially different than the ability to force publishing a new version. can you help us understand what is failing in your scenario if it is different?
Is this repo public?? Kindly share a link to it if it is 🤔
@babblebey, we need to support backward compatibility of how the old feature worked when using GraphQL instead of search API. Thanks in advance people!