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

[Devops] Feature/221 add openapi linting #243

Merged
merged 21 commits into from
Aug 24, 2024

Conversation

sikutisa
Copy link
Contributor

@sikutisa sikutisa commented Aug 20, 2024

Description

swagger.json 생성

  • 최초에서는 빌드 시점에서 json을 생성해 이를 활용하려 하였으나, SwashBuckle.AspNetCore.Cli로 생성된 json에 severs에 대한 정보가 누락되는 것을 확인했습니다.
    • 이에 앱을 run 시키고 swagger.json을 카피해서 사용하였습니다.

doc linting

  • github action task 상에서 Spectral cli를 설치하여 사용했습니다.
  • 위에서 json 파일이 생성되는 경로와 이름에 따라 설정이 변경될 수 있습니다.
  • lint 결과 error가 없더라도 warning인 요소가 존재하면 github action이 fail이 되도록 처리했습니다.

논의사항

  • 제 개인 레포에서 api 규약을 충족하지 못했을 때 에러 발생해 파이프라인이 fail이 뜨는 것은 확인했는데, unit test 결과처럼 어떤 부분에서 문제가 있었는지 PR 코멘트로 확인하는 방법이 적용돼야 하나 고민 중입니다. 지금은 문제를 확인하려면 깃헙 액션에 들어가서 로그 내 링크를 타고 들어가야 하는 상황입니다.

Add settings for OpenAPI linting in build stage

Related to: aliencube#221
spectral-action requires "check: write" permission

Related to: aliencube#221
@sikutisa sikutisa force-pushed the feature/221-add-openapi-linting branch from c7546a9 to 7604201 Compare August 20, 2024 14:13
Copy link
Contributor

@justinyoo justinyoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코멘트 남겨뒀습니다. 확인해 주세요!

@justinyoo
Copy link
Contributor

제 개인 레포에서 api 규약을 충족하지 못했을 때 에러 발생해 파이프라인이 fail이 뜨는 것은 확인했는데, unit test 결과처럼 어떤 부분에서 문제가 있었는지 PR 코멘트로 확인하는 방법이 적용돼야 하나 고민 중입니다. 지금은 문제를 확인하려면 깃헙 액션에 들어가서 로그 내 링크를 타고 들어가야 하는 상황입니다.

이게 지금 권한 문제가 생겨서 방법을 찾는 중입니다. ㄷㄷㄷ 현재로서는 액션 결과 화면에서만 볼 수 있게 되어 있어요.

@justinyoo justinyoo linked an issue Aug 21, 2024 that may be closed by this pull request
@sikutisa sikutisa changed the title [WIP] Feature/221 add openapi linting [Devops][WIP] Feature/221 add openapi linting Aug 22, 2024
sikutisa and others added 2 commits August 22, 2024 22:42
Since openapi.json does not always need to be created after build,
the command is separated from the csproj file into a github action task.

Related to: aliencube#221
@sikutisa sikutisa changed the title [Devops][WIP] Feature/221 add openapi linting [Devops] Feature/221 add openapi linting Aug 22, 2024
Copy link
Contributor

@justinyoo justinyoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

몇가지 아이디어를 코멘트로 남겼습니다. 같이 논의해 봐요.

To keep the Verb + Object format

Related to: aliencube#221
@sikutisa sikutisa force-pushed the feature/221-add-openapi-linting branch from 196daf7 to f01d6ac Compare August 23, 2024 15:08
spectral cli is not suitable for providing report

Related to: aliencube#221
Because of github token and permisson issues

Related to: aliencube#221
@sikutisa sikutisa force-pushed the feature/221-add-openapi-linting branch from 87193da to 12f800b Compare August 24, 2024 04:02
remove swashbuckle-cli because openapi.json created by swashbuckle-cli
does not contains OpenAPI servers info.

In github task, Waring is also treated as Error on this project.

Related to: aliencube#221
seperate run integration tests job to Run AzureOpenAIProxy.AppHost in
background and Run integration tests

Related to: aliencube#221
Copy link
Contributor

@justinyoo justinyoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@justinyoo justinyoo merged commit 58fe21c into aliencube:main Aug 24, 2024
1 check passed
@sikutisa sikutisa deleted the feature/221-add-openapi-linting branch August 24, 2024 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[GitHub Actions] Add OpenAPI linting
2 participants