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

fix: delete runtime images before deleting application #960

Merged
merged 2 commits into from
Sep 2, 2024

Conversation

pirosiki197
Copy link
Contributor

なぜやるか

fix #959
アプリの削除をする際、外部キーで紐づいているデータを削除しなければならないが、runtime_imagesから削除する処理が抜けていたため、アプリを削除できないようになっていた

やったこと

アプリ削除の前に紐づいているデータを削除する

やらなかったこと

資料

Copy link

github-actions bot commented Sep 2, 2024

Preview (prod backend + PR dashboard) → https://960.ns-preview.trapti.tech/

@@ -102,6 +102,7 @@ type ArtifactRepository interface {

type RuntimeImageRepository interface {
CreateRuntimeImage(ctx context.Context, image *RuntimeImage) error
DeleteRuntimeImagesByAppID(ctx context.Context, appId string) error
Copy link
Member

Choose a reason for hiding this comment

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

[nits] RuntimeImageに関する操作なのは、型名と、メソッドを呼び出すときにも runtimeRepo.Delete... とか呼び出すことからわかるので、メソッド名にRuntimeImageとあるのは少し冗長かもしれないです

気になったら程度で良いですが

Copy link
Contributor Author

Choose a reason for hiding this comment

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

これは自分も少し思ったのですが、他の repository の命名と合わせて 'RuntimeImages' も入れておきました
https://github.com/traPtitech/NeoShowcase/blob/main/pkg/domain/repository.go
もし DeleteByAppIDとするなら他も全部変えちゃいたいですが、そこまでするほどでもないかな、と思うので今はこのままにしておこうと思います

@pirosiki197 pirosiki197 merged commit fac5dbc into main Sep 2, 2024
13 checks passed
@pirosiki197 pirosiki197 deleted the fix/delete_app branch September 2, 2024 12:51
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

Successfully merging this pull request may close these issues.

[Bug]: アプリの削除ができない
2 participants