-
-
Notifications
You must be signed in to change notification settings - Fork 302
feat: branching #3246
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
base: main
Are you sure you want to change the base?
feat: branching #3246
Changes from all commits
c765db7
b0a68a4
06a546a
17dc6c3
781946c
4736353
3e39270
d5cf14e
554d886
3408997
912d60b
aac588e
6bcf925
cfddcdc
ae6cd4e
a3e33c6
fb16af8
2ed2c66
6a39a5b
21169fc
64e2986
28f666d
7019c2f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,7 @@ class KeyControllerCreationTest : ProjectAuthControllerTest("/v2/projects/") { | |
.andIsCreated.andPrettyPrint.andAssertThatJson { | ||
node("id").isValidId | ||
node("name").isEqualTo("super_key") | ||
node("branch").isEqualTo("main") | ||
} | ||
} | ||
|
||
|
@@ -82,6 +83,17 @@ class KeyControllerCreationTest : ProjectAuthControllerTest("/v2/projects/") { | |
} | ||
} | ||
|
||
@ProjectJWTAuthTestMethod | ||
@Test | ||
fun `creates key with default branch (branch parameter not provided)`() { | ||
performProjectAuthPost("keys", CreateKeyDto(name = "super_key_to_main_branch", branch = "dev")) | ||
.andIsCreated.andAssertThatJson { | ||
node("id").isValidId | ||
node("name").isEqualTo("super_key_to_main_branch") | ||
node("branch").isEqualTo("dev") | ||
} | ||
} | ||
Comment on lines
+86
to
+95
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix misleading test name. The test name states "creates key with default branch (branch parameter not provided)" but the test actually provides an explicit branch parameter ( Apply this diff to correct the test name: - fun `creates key with default branch (branch parameter not provided)`() {
- performProjectAuthPost("keys", CreateKeyDto(name = "super_key_to_main_branch", branch = "dev"))
+ fun `creates key with explicit branch`() {
+ performProjectAuthPost("keys", CreateKeyDto(name = "super_key_to_dev_branch", branch = "dev"))
.andIsCreated.andAssertThatJson {
node("id").isValidId
- node("name").isEqualTo("super_key_to_main_branch")
+ node("name").isEqualTo("super_key_to_dev_branch")
node("branch").isEqualTo("dev")
}
} 🤖 Prompt for AI Agents
|
||
|
||
@ProjectJWTAuthTestMethod | ||
@Test | ||
fun `validates description`() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,4 +144,13 @@ class KeyControllerKeySearchTest : ProjectAuthControllerTest("/v2/projects/"), L | |
time.assert.isLessThan(4000) | ||
} | ||
} | ||
|
||
@Test | ||
@ProjectJWTAuthTestMethod | ||
fun `it search in default branch only`() { | ||
saveAndPrepare() | ||
performProjectAuthGet("keys/search?search=this-is-branched-key&languageTag=de").andAssertThatJson { | ||
node("_embedded").isAbsent() | ||
} | ||
} | ||
Comment on lines
+148
to
+155
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major 🧩 Analysis chainFix test name consistency and verify test data setup.
Apply this diff to fix the test name: - fun `it search in default branch only`() {
+ fun `it searches in default branch only`() { Run the following script to verify the test data includes a branched key: 🏁 Script executed: #!/bin/bash
# Verify that KeySearchTestData creates a branched key named "this-is-branched-key"
ast-grep --pattern $'class KeySearchTestData {
$$$
}'
rg -A 20 "class KeySearchTestData" --type=kt Length of output: 26 #!/bin/bash
# Locate KeySearchTestData definition
find . -type f -name "*KeySearchTestData*.kt"
# Inspect the class declaration for test data setup
rg -n "class KeySearchTestData" -C5 .
# Search for the branched key name within the repository
rg -n "this-is-branched-key" -C5 . 🏁 Script executed: #!/bin/bash
# Locate the KeySearchTestData Kotlin file
find . -type f -name "*KeySearchTestData*.kt"
# Search for the branched key literal across all Kotlin files
rg -n "this-is-branched-key" -g '*.kt' Length of output: 490 🏁 Script executed: #!/bin/bash
# Show class header to see project and branch setup
sed -n '1,50p' backend/data/src/main/kotlin/io/tolgee/development/testDataBuilder/data/KeySearchTestData.kt
# Inspect addKeyWithTranslations implementation
rg -n "fun addKeyWithTranslations" -C10 backend/data/src/main/kotlin/io/tolgee/development/testDataBuilder/data/KeySearchTestData.kt
# Search for branch creation within the file
rg -n "branch" -C5 backend/data/src/main/kotlin/io/tolgee/development/testDataBuilder/data/KeySearchTestData.kt Length of output: 2500 Rename test function for naming consistency - fun `it search in default branch only`() {
+ fun `it searches in default branch only`() { 🤖 Prompt for AI Agents
|
||
} |
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.
Annotate
branch
as a query param to ensure binding and OpenAPI docs.Without
@RequestParam
, Spring may not bind it and OpenAPI may not render it as query param.Apply:
🤖 Prompt for AI Agents