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

Hotfix/cicd workflow 수정 #180

Merged
merged 7 commits into from
May 19, 2024
Merged

Hotfix/cicd workflow 수정 #180

merged 7 commits into from
May 19, 2024

Conversation

sgh002400
Copy link
Contributor

@sgh002400 sgh002400 commented May 17, 2024

👩‍💻 Contents

  • develop 브랜치에 merge시 ci, cd가 두번씩 실행되는 현상 확인
    • develop, main 브랜치에 pr을 통해 merge 되면 CI를 수행 후 수행이 성공 했을 때만 CD를 수행하도록 개선

📝 Review Note

  • 문제 발생 원인
    • main, dev 브랜치 직접 푸쉬하는 경우도 있을 것 같아서 그것도 CI를 수행하도록 설정 해뒀는데, 이 경우 PR 날려서 Merge 하는 경우 CI가 두 번 수행되고 CI가 성공하면 CD 프로세스를 진행하도록 해둬서 CD도 두 번 수행됨

📣 Related Issue

✅ 점검사항

  • docker-compose.yml 파일에 마이그레이션 한 API의 포워딩을 변경해줬나요?
  • Spring Secret 값을 수정하거나 추가했다면 Github Secret에서 수정을 해줬나요?
  • Nestjs Secret 값을 수정하거나 추가했다면 Docker-Compose.yml 파일 및 인스턴스 내부의 .env 파일을 수정했나요?

Copy link

height bot commented May 17, 2024

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

Copy link
Member

@mikekks mikekks left a comment

Choose a reason for hiding this comment

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

고생하셨습니다! 궁금한 부분 질문남겼습니다~

Comment on lines 3 to 9
workflow_run:
workflows: [ "Makers_Crew CI" ]
branches: [ "develop" ]
types: [ completed ]
workflows: ["Makers_Crew CI"]
branches: [develop]
types: [completed]

push:
branches: [ "develop" ]
Copy link
Member

Choose a reason for hiding this comment

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

여기 on 이하의 동작을 아래와 같이 이해했는데 맞을까요??

  1. workflow_run : "Makers_Crew CI" 작업이 develop 브랜치에 완료되면 Makers_Crew Dev CD 작업이 트리거 된다.
  2. push : develop 브랜치에 push되면 Makers_Crew Dev CD 작업이 트리거 된다.

만약 맞다면 트리거가 2개인거 같은데 어떻게 생각하시나요??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ci는 pr이 오픈 됐을 때, pr에 커밋을 푸쉬 했을 때, pr이 재오픈 됐을 때 수행됩니다. 그리고 cd는 dev 브랜치에서 ci가 성공 했을 때, dev 브랜치에 push 이벤트가 발생 했을 때 수행되기 때문에 dev 브랜치에 merge가 됐을 때(push 이벤트 발생) cd가 한번 수행되게 됩니다.

Pr에서 매 커밋마다 ci를 수행하기 때문에 dev 브랜치에 merge 될 때 문제 없는 상태가 보장 되겠지만 제가 의도한건 ci가 수행되고 이가 성공 했을 때 cd가 수행되는 것이기 때문에 의도와는 살짝 다르긴 하네요!

모든 branch에 push 이벤트가 발생할 때 ci를 수행하고, dev 브랜치에 ci가 완료될 때 cd를 수행하도록 개선할 수 있을 것 같습니다. 좋은 지적 감사해요☺️

Copy link
Member

Choose a reason for hiding this comment

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

아하 그렇군요!
넵 고생하셨습니다!!

Copy link
Member

@mikekks mikekks left a comment

Choose a reason for hiding this comment

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

스크린샷 2024-05-18 오후 5 18 22

혹시 이 커밋 로그에 대해서는 어떻게 생각하시는지 궁금합니다!! 저는 개인적으로 저런 상황일 때는 rebasestash를 사용해서 저런 로그들을 지우는 편인데요!
저희가 현재 squash 전략을 하고 있어서, 나중에 문제가 생겼을 때 추적하는게 편리하다고 생각이 들어서 제안을 드려볼까 하는데 어떻게 생각하시나요?! 편하게 말씀주시면 감사하겠습니다 :)

@sgh002400 sgh002400 merged commit 5e2dd29 into develop May 19, 2024
1 check passed
@mikekks mikekks deleted the hotfix/ci branch August 4, 2024 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants