-
Notifications
You must be signed in to change notification settings - Fork 4
fix(extensions): underscores are invalid in prerelease #175
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fbfd173
fix(extensions): underscores are invalid in prerelease
roxspring c95f760
chore(spotless): Update copyright headers
roxspring d0c58e4
Update src/main/kotlin/com/figure/gradle/semver/internal/extensions/R…
tbcrawford 651a12e
Update src/main/kotlin/com/figure/gradle/semver/internal/extensions/R…
tbcrawford 3a4aecd
fix(branching): support cross-repo PRs
tbcrawford f09adf1
Cleanup
tbcrawford 0675aae
Update Copyright year
tbcrawford b9c1e0a
Fix the right Copyright year
tbcrawford File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/kotlin/com/figure/gradle/semver/internal/command/extension/RefExtensions.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
src/test/kotlin/com/figure/gradle/semver/internal/extensions/RefExtensionsKtSpec.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| /* | ||
| * Copyright (C) 2025 Figure Technologies | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package com.figure.gradle.semver.internal.extensions | ||
|
|
||
| import io.github.z4kn4fein.semver.nextPreRelease | ||
| import io.github.z4kn4fein.semver.toVersion | ||
| import io.kotest.core.spec.style.FunSpec | ||
| import io.kotest.matchers.shouldBe | ||
| import org.eclipse.jgit.lib.Constants | ||
| import org.eclipse.jgit.lib.ObjectId | ||
| import org.eclipse.jgit.lib.Ref | ||
| import org.eclipse.jgit.lib.Ref.Storage | ||
|
|
||
| class RefExtensionsKtSpec : FunSpec({ | ||
| test("prereleaseLabel for dependabot branch") { | ||
| // Create a test implementation of Ref | ||
| val branchName = "dependabot-github_actions-softprops-action-gh-release-2" | ||
| val fullRefName = Constants.R_HEADS + branchName | ||
|
|
||
| // Create a mock Ref with the specified branch name | ||
| val ref = object : Ref { | ||
| override fun getName(): String = fullRefName | ||
|
|
||
| override fun getObjectId(): ObjectId? = null | ||
|
|
||
| override fun getPeeledObjectId(): ObjectId? = null | ||
|
|
||
| override fun isPeeled(): Boolean = false | ||
|
|
||
| override fun getStorage(): Storage = Storage.LOOSE | ||
|
|
||
| override fun isSymbolic(): Boolean = false | ||
|
|
||
| override fun getTarget(): Ref? = null | ||
|
|
||
| override fun getLeaf(): Ref = this | ||
| } | ||
|
|
||
| // Test the prereleaseLabel extension function | ||
| val expectedLabel = "dependabot-github-actions-softprops-action-gh-release-2" | ||
| ref.prereleaseLabel() shouldBe expectedLabel | ||
|
|
||
| // Test the prereleaseLabel extension function produces valid preRelease values | ||
| val expectedVersion = "1.0.1-$expectedLabel".toVersion(true) | ||
| "1.0.0".toVersion(true).nextPreRelease(expectedLabel) shouldBe expectedVersion | ||
| } | ||
| }) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.