Skip to content

[#142][FEATURE] 그룹 해시태그 기능 추가#144

Merged
unikal1 merged 18 commits intodevfrom
feat/group-hashtag
Jan 9, 2026
Merged

[#142][FEATURE] 그룹 해시태그 기능 추가#144
unikal1 merged 18 commits intodevfrom
feat/group-hashtag

Conversation

@unikal1
Copy link
Contributor

@unikal1 unikal1 commented Dec 23, 2025

테스트 개편에 대한 부분이 많습니다. 실제 비지니스 로직 부분은 그리 많지 않습니다.

✨ 구현 기능 명세

그룹 hashTag create

각 그룹 생성 시 hashTag 를 함께 저장할 수 있습니다. 해시태그의 유무는 선택이며, 최대 개수 5개, 각 문자열의 길이는 20 입니다.

이는 HashTag 엔티티와 GroupHashTag 엔티티를 통해 관리합니다. HashTag 엔티티는 정규화된 문자열을 기준으로 하여 실제 데이터를 저장하고 있으며 추후 검색을 위해 정규화된 값입니다. 사용자가 해시태그에 대해 검색 시 해당 엔티티를 거칩니다.

groupHashTag 엔티티는 groupId, hashTagId 뿐만 아니라 실제 hashtag 의 원본을 가지고 있습니다. 이는 실제로 그룹 검색 시 클라이언트에게 보여지는 부분이며, 정규화되기 이전의 값입니다. 대부분, 사용자가 입력한 데이터 원본입니다.

현재는 group create 시에만 hashTag 가 같이 저장하는 부분만 구현되어 있습니다.

RetryTx

@Transactional 어노테이션의 대체제이며, 실패 시 새로운 트랜잭션을 열어 재시도하는 어노테이션입니다. 자세한 내용은 retryTx 재시도 전략 를 참고해주세요.

test 및 build 환경 개편

run/debug configurations 에서 VM options 에 다음 두 값을 입력할 수 있습니다.

-Dspring.profiles.active, -Dtc.disable 이며, 각각 local, test, true, false 가 올 수 있습니다.

전자는 테스트 및 빌드 시 어떤 프로필을 사용할지에 대한 내용이며, 기본 default 에 덮어씌워질 수 있습니다.

후자는 TestContainer 활성 여부를 선택하며, false 선택 시 활성화된 profile 로 테스트를 수행할 수 있습니다.

local, false 조합 사용 시, localhost 로 빌드/테스트를 수행할 수 있습니다.

- hashTag 및 group 과의 매핑 테이블 groupHashTag 정의
- mapping table 상에서 group/hashtag 에 대한 lazy loading
- tag 에 대한 유니크(+인덱싱)
- groupHashTag 에서 group 에 대한 인덱싱

Ref: #132
- usedCount 필드 원자적 증감/soft delete 추가
- n+1 방지 fetch join 메서드 추가
- 자동완성 용 prefix 용 조회 메서드 추가

Ref: #132
- 실제 저장되는 값과, 보여지는 데이터를 분리하여 보여지는 데이터를 groupHashTag 에 추가

Ref: #132
- 해시태그 정규화 및 ui 상 보여지는 이름 분리(실제 저장과 외부 노출 값 분리)
- 동시성 문제로 인한 unique 예외에 대비한 1회 재시도 전략
- 이미 존재하는 태그는 1 추가/ 아닌 경우는 새롭게 생성

Ref: #132
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds group hashtag functionality to the application, allowing users to associate hashtags with groups during creation. However, there's a mismatch between the PR title/implementation and the referenced issue #132, which is actually about username/nickname duplicate checking, not group hashtags.

Key Changes:

  • Added hashtag normalization utility (StringUtils) that sanitizes user input by removing special characters, converting spaces to underscores, and handling edge cases
  • Implemented entities (HashTag, GroupHashTag) and repositories to support many-to-many relationship between groups and hashtags with usage tracking
  • Created GroupHashTagWorker with concurrency handling for saving hashtags with duplicate detection and retry logic

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 18 comments.

Show a summary per file
File Description
StringUtils.java New utility class for normalizing hashtag strings with pattern-based sanitization
GroupHashTagWorker.java New worker class handling hashtag persistence, normalization, and concurrency conflicts
HashTag.java New entity representing hashtags with usage count tracking and soft delete support
GroupHashTag.java New junction entity mapping groups to hashtags with display tag preservation
HashTagRepository.java Repository with custom queries for hashtag operations including autocomplete and bulk updates
GroupHashTagRepository.java Repository for group-hashtag mappings with fetch join optimization
CreateGroupReq.java Added hashTags field to group creation DTO
GroupServiceImpl.java Integrated hashtag saving into group creation workflow

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI commented Dec 25, 2025

@dioo1461 I've opened a new pull request, #148, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Dec 25, 2025

@dioo1461 I've opened a new pull request, #149, to work on those changes. Once the pull request is ready, I'll request review from you.

- naming, null check, 일부 잠재적인 동시성 오류 부분 수정

Ref: #142
Copy link
Contributor

@sleepyhoon sleepyhoon left a comment

Choose a reason for hiding this comment

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

1차 리뷰입니다.

- transactional 을 덮는 RetryTx 어노테이션 추가

Ref: #142
- retry 정상 작동 여부 테스트
- hashTag 관련한 변경으로 인해 실패하는 테스트 수정
- aspect 시 annotation 이 제대로 들어가지 않는 문제 해결
- 주석 추가

Ref: #142
- hashtag 삭제를 batch 서버로 이전함에 따라, 1차 캐시 초기화 불필요로 인한 삭제

Ref: #142
- 기존 prefix 를 토대로 검색을 대신하여 중간에 값이 있어도 검색 가능하도록 변경

Ref: #142
- local/ test / prod 분리 및 운용 DB 분리
- 자세한 내용은 위키 참조

Ref: #142
- test 프로파일 적용 제거
- hash tag 테스트 추가
- retryTx 성능 테스트 시 db 초기화 로직 추가
- 문자열 정규화 로직 추가
- 그 외 테스트 유틸 수정

Ref: #142
- 기존에 -Dspring.profiles.active 환경변수가 있으면 이를 사용, 없으면 test 프로필 적용

Ref: #142
@unikal1 unikal1 requested a review from sleepyhoon January 6, 2026 01:40
- 잘못 작성된 이름 수정

Ref: #142
@unikal1
Copy link
Contributor Author

unikal1 commented Jan 6, 2026

@sleepyhoon 리뷰 반영 및 retryTx 어노테이션 관련 추가, 일부 자잘한 로직 등을 개편하였습니다.

application.properties 구조를 개편하였습니다. 중복된 부분을 제거하고 각 상황에 맞게 prod(application.properties), local(application-local.properties), test(application-test.properties)로 구분하였습니다.

tc.disable vm 환경변수를 사용하여 test container 사용 여부를 분리하였습니다. 빌드/테스트 시 해당 변수를 이용해 임시 컨테이너를 사용하여 테스트할지 등을 볼 수 있습니다.

spring.profiles.active 를 덮어씌울 수 있습니다. vm 환경변수를 통해 test 시 test 프로필 외에도 다른 프로필을 임의로 적용할 수 있습니다.

@unikal1 unikal1 changed the title [#132][FEATURE] 그룹 해시태그 기능 추가 [#142][FEATURE] 그룹 해시태그 기능 추가 Jan 6, 2026
Copy link
Contributor

@sleepyhoon sleepyhoon left a comment

Choose a reason for hiding this comment

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

2차 리뷰 입니다

Copy link
Contributor

@sleepyhoon sleepyhoon left a comment

Choose a reason for hiding this comment

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

properties 파일 리뷰입니다.

- search 관련 주석 변경
- application-local.properties 가 더 이 상 git 에서 추적되지 않음.

Ref: #142
@unikal1 unikal1 force-pushed the feat/group-hashtag branch from b77b5f2 to 6a9dc00 Compare January 8, 2026 00:46
@unikal1 unikal1 requested a review from sleepyhoon January 8, 2026 00:48
@sleepyhoon
Copy link
Contributor

LGTM

@unikal1
Copy link
Contributor Author

unikal1 commented Jan 9, 2026

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6a9dc00efb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@study-pals study-pals deleted a comment from chatgpt-codex-connector bot Jan 9, 2026
@study-pals study-pals deleted a comment from chatgpt-codex-connector bot Jan 9, 2026
@unikal1 unikal1 merged commit 2dfd591 into dev Jan 9, 2026
@unikal1 unikal1 deleted the feat/group-hashtag branch January 9, 2026 02:30
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.

[FEATURE] 그룹 해시태그 기능 추가

3 participants