-
Notifications
You must be signed in to change notification settings - Fork 5
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
[feat] Rest Docs 적용 #73
[feat] Rest Docs 적용 #73
Conversation
- build.gradle 의존성 및 task 추가 - custom snippet 추가
- CommonCodeController 에 테스트용 api 추가 - common 용도의 RestDocumentUtils 및 ControllerTest 파일 추가 - 샘플용 CommonCodeControllerRestDocsTest 추가
- index.adoc 추가 (내부에 include 방식으로 다른 api adoc 추가함) - 샘플용 sample-api.adoc 추가
|
||
tasks.register("prepareKotlinBuildScriptModel") {} No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are some findings and suggestions for the code patch:
-
Dependency Upgrade: Consider upgrading the dependencies to their latest versions, as newer versions often include bug fixes and improvements.
-
Configuration Block: Move the
ext
block inside thejava
block for better organization. -
Output Directory: Add the output directory for Asciidoctor generated snippets (
snippetsDir
) as an input for theasciidoctor
task to track changes properly. -
Configuration Name: Change
asciidoctorExt
to a more descriptive name, likerestdocsAsciidoctor
, as it is used for Spring REST Docs. -
Ensure Clean Slate: Delete the existing
src/main/resources/static/docs
directory before generating new documentation to avoid any stale files remaining. -
Documentation Copy: Create a task named
copyDocument
that depends on theasciidoctor
task. This task copies the generated AsciiDoc files frombuild/docs/asciidoc
tosrc/main/resources/static/docs
. -
Jar Creation: Configure the
bootJar
task to depend on thecopyDocument
task so that the generated documentation is included in the final JAR file.
Overall, these changes improve the build process and ensure that the latest documentation is included in the application's distribution.
- Rest Docs로 생성된 html 파일 ignore 대상에 추가
module-api/.gitignore
Outdated
/src/main/resources/static/docs | ||
|
||
### VS Code ### | ||
.vscode/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code patch you provided seems to be a .gitignore
file. It specifies the files and directories that should be ignored by Git when tracking changes in a project. Here are some observations and suggestions based on the provided patch:
-
It's generally a good practice to include a top-level directory, such as the project root, before specifying individual files and directories to ignore. This ensures that the
.gitignore
rules apply correctly to the entire project. -
The
HELP.md
file is mentioned at the beginning of the patch. If this file is meant to be ignored, it should be removed from version control. Otherwise, it will continue to be tracked. -
The exclusion patterns using
!
(e.g.,!**/src/main/**/build/
) are intended to override previous ignore patterns and include specific files or directories. Make sure these patterns align with your project structure and desired behavior. -
It's recommended to exclude generated build artifacts like
build/
,bin/
, andout/
directories to avoid including compiled files in version control. However, be cautious when applying such exclusions to ensure necessary build configuration files are not inadvertently ignored. -
Integrated development environment (IDE)-specific directories and files like
.gradle
,.idea
, and.vscode/
are excluded. This assumes that developers using different IDEs will generate their own specific configuration files without affecting the core project. -
The
*/src/main/*/out/
and*/src/test/*/out/
patterns suggest excluding specific output directories from source directories that may contain generated files. This can be helpful to avoid including intermediate build results. -
The
/src/main/resources/static/docs
directory is included, implying that its contents should be tracked in version control. Ensure this matches the intended behavior; otherwise, if the documentation is dynamically generated or updated during builds, it may be better to exclude it.
Remember to periodically review and update your .gitignore
file as the project evolves and new files or build artifacts are introduced. Additionally, consider collaborating with other developers on the project to fine-tune the ignore rules based on their respective development environments and tools.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
- Rest Docs로 생성된 html 파일 ignore 대상에 추가 - 잘못 올라간 module-api/.gitignore 파일은 삭제
@@ -39,5 +39,8 @@ out/ | |||
### MAC ### | |||
.DS_Store | |||
|
|||
### rest docs ### | |||
!**/src/main/**/static/docs | |||
|
|||
### log ### | |||
*.log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code patch you provided mainly consists of changes to the .gitignore
file. It appears that the patch updates the list of files and directories that should be ignored by Git.
The added line !**/src/main/**/static/docs
suggests that the rule for ignoring files in the static/docs
directory has been reversed. Instead of ignoring it, the patch instructs Git to include these files in the repository. This change is likely intentional to ensure that the REST documentation (static/docs
) is now being tracked by Git.
Regarding bug risks and improvement suggestions, it's challenging to provide a comprehensive review without more context or visibility into your project. However, here are a few general considerations:
-
Ensure the importance of each change: Review all modifications made by the patch to confirm they are necessary for your project. Superfluous changes can introduce unnecessary complexity and increase the risk of errors.
-
Validate the updated
.gitignore
rules: Check whether the new patterns added to the.gitignore
file accurately match the files and directories you intend to ignore or include. -
Assess the handling of sensitive or generated files: Pay attention to how sensitive files (e.g., configuration files containing passwords) and automatically generated files are managed. Make sure they are appropriately excluded and not inadvertently committed to the repository.
-
Consider using version control for documents cautiously: Including documentation files in the repository can lead to larger repository sizes and possible merge conflicts. Verify that this decision aligns with your project requirements and preferences.
Ultimately, a thorough code review considers the broader context, architecture, and goals of the project. It may be beneficial to involve other team members or utilize code review tools to help analyze the changes in detail and provide specific recommendations for improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
include::overview.adoc[] | ||
include::sample-api.adoc[] | ||
// FIXME :: 위 라인 1줄은 추후 삭제 예정입니다 No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provided code patch appears to be written in AsciiDoc format and aimed at generating an API documentation book. Here are some observations and suggestions:
- It is missing the AsciiDoc header that defines document attributes, such as the title, author, and date. Make sure to add those attributes for a complete documentation.
- The "include" statements at the bottom indicate the inclusion of other AsciiDoc files (
overview.adoc
andsample-api.adoc
). Check if these file paths are correct and if the content they provide is relevant and up-to-date. - The line "// FIXME :: 위 라인 1줄은 추후 삭제 예정입니다" seems to be a comment indicating that it should be removed later. It's good to have a plan for clearing out such placeholders after taking the necessary actions. Make sure to remove it when appropriate.
- Consider adding more sections to the table of contents (TOC) by adjusting the
:toclevels
attribute based on the desired depth of the TOC.
Since this is only a small portion of your code, a more comprehensive review might require examining the included AsciiDoc files and the overall structure of your API documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
회의 통해서 설명 잘 들었습니다 LGTM
💡 Motivation and Context
테스트 코드 성공 시, Rest Docs를 통해 API 문서화를 할 수 있습니다
🔨 Modified
아래는 적용 방식을 설명합니다
1. ControllerTest
2. 도메인별 ControllerTest
(단, FixtureMonkey는 주입이 안되서 사용하는 테스트 파일에 별도로 추가 필요해보임)
3. 도메인별 adoc 파일 관리
🌟 More
📋 커밋 전 체크리스트
🤟🏻 PR로 완료된 이슈
closes #72