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

[BUG] graphql update schema operations are not working #693

Open
nepsmaddy opened this issue Oct 21, 2024 · 2 comments
Open

[BUG] graphql update schema operations are not working #693

nepsmaddy opened this issue Oct 21, 2024 · 2 comments

Comments

@nepsmaddy
Copy link
Contributor

Release version

v6.0.1.1

Describe the bug

When you update the graphql schema and run the extractor, it will only generate the specification.json file as a change. But publisher will fail because tool expects apiInformation.json file is also needed to make it work. please find below error.

crit: Publisher[0] System.InvalidOperationException: API **** has an empty JSON object. at **publisher.Api.GetApiJson(ApiName apiName, ApiInformationFile apiInformationFile, ApiSpecificationFile specificationFile, JsonObject** configurationApiJson, CancellationToken cancellationToken) at publisher.Api.PutApi(ApiName apiName, ApiInformationFile apiInformationFile, ApiSpecificationFile specificationFile, JsonObject configurationApiJson, ServiceUri serviceUri, PutRestResource putRestResource, ILogger logger, CancellationToken cancellationToken) at publisher.Api.<>c__DisplayClass23_0.<<ProcessArtifactsToPut>b__4>d.MoveNext() --- End of stack trace from previous location --- at System.Threading.Tasks.Parallel.<>c__501.<b__50_0>d.MoveNext()
--- End of stack trace from previous location ---
at common.IEnumerableExtensions.ForEachParallel[T](IEnumerable1 enumerable, Func2 action, CancellationToken cancellationToken)
at publisher.Api.ProcessArtifactsToPut(IReadOnlyCollection1 files, JsonObject configurationJson, ServiceDirectory serviceDirectory, ServiceUri serviceUri, PutRestResource putRestResource, ILogger logger, CancellationToken cancellationToken) at publisher.Service.ProcessArtifactsToPut(IReadOnlyCollection1 files, JsonObject configurationJson, ServiceDirectory serviceDirectory, ServiceUri serviceUri, ListRestResources listRestResources, PutRestResource putRestResource, DeleteRestResource deleteRestResource, ILogger logger, CancellationToken cancellationToken)
at publisher.Publisher.ProcessCommitIdFilesToPut(IReadOnlyCollection1 commitIdFilesToPut, CancellationToken cancellationToken) at publisher.Publisher.RunWithCommitId(CommitId commitId, CancellationToken cancellationToken) at publisher.Publisher.Run(CancellationToken cancellationToken) at publisher.Publisher.ExecuteAsync(CancellationToken cancellationToken) info: Microsoft.Hosting.Lifetime[0]
You can see the GetAPIJson function expects apiInformationfile to be present while calling.

Expected behavior

It should run without apiinformtion file as we are changing specification only and it is update to the existing graphQL API.

Actual behavior

Publisher failing with the above error if we don't put apiInfomation.json file in changes. We have to manually make any dummy updates in the apiInformation file so extractor detects it and then publisher work fine.

Reproduction Steps

  1. use any existing graphQl api. Make schema updates to the same
  2. run extractor
  3. see the generated changed artifacts in the PR
  4. it has generated only specification.json for the api
  5. Run the publisher with the last commit option and this error will pop up.
Copy link

  Thank you for opening this issue! Please be patient while we will look into it and get back to you as this is an open source project. In the meantime make sure you take a look at the [closed issues](https://github.com/Azure/apiops/issues?q=is%3Aissue+is%3Aclosed) in case your question has already been answered. Don't forget to provide any additional information if needed (e.g. scrubbed logs, detailed feature requests,etc.).
  Whenever it's feasible, please don't hesitate to send a Pull Request (PR) our way. We'd greatly appreciate it, and we'll gladly assess and incorporate your changes.

@waelkdouh
Copy link
Contributor

We will take a look at this.

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

2 participants