Azure / Azure/apiops

[BUG] graphql update schema operations are not working

Abierto
#693 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
C#
Estrellas
448
Forks
247
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### 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.<b__4>d.MoveNext()
--- End of stack trace from previous location ---
at System.Threading.Tasks.Parallel.<>c__50`1.<b__50_0>d.MoveNext()
--- End of stack trace from previous location ---
at common.IEnumerableExtensions.ForEachParallel[T](IEnumerable`1 enumerable, Func`2 action, CancellationToken cancellationToken)
at publisher.Api.ProcessArtifactsToPut(IReadOnlyCollection`1 files, JsonObject configurationJson, ServiceDirectory serviceDirectory, ServiceUri serviceUri, PutRestResource putRestResource, ILogger logger, CancellationToken cancellationToken)
at publisher.Service.ProcessArtifactsToPut(IReadOnlyCollection`1 files, JsonObject configurationJson, ServiceDirectory serviceDirectory, ServiceUri serviceUri, ListRestResources listRestResources, PutRestResource putRestResource, DeleteRestResource deleteRestResource, ILogger logger, CancellationToken cancellationToken)
at publisher.Publisher.ProcessCommitIdFilesToPut(IReadOnlyCollection`1 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.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza en publisher.Api.GetApiJson y sigue cómo se pasan los artefactos modificados del extractor al publisher. Reproduce la actualización del esquema de GraphQL únicamente con el extractor y confirma después que la publicación se realiza correctamente sin un archivo apiInformation.json modificado, mientras se sigue procesando specification.json.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
csharp, graphql
Área
api, backend-api-design
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.