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

make finding a staging profile more lenient #498

Merged
merged 2 commits into from
Jan 15, 2023
Merged

Conversation

gabrielittner
Copy link
Collaborator

Closes #496

The logic is now:

  • if there is just one profile always use that regardless of whether the name matches
  • profile that equals the group id
  • profile that is a prefix for the group id
  • profile that shares a prefix with the group id

Comment on lines 55 to 63
var candidateProfiles = allProfiles.filter { group == it.name }

if (candidateProfiles.isEmpty()) {
candidateProfiles = allProfiles.filter { group.startsWith(it.name) }
}

if (candidateProfiles.isEmpty()) {
candidateProfiles = allProfiles.filter { group.commonPrefixWith(it.name).isNotEmpty() }
}

Choose a reason for hiding this comment

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

This can be done in one-liner as...

val candidateProfiles = allProfiles.filter { group == it.name }
    .ifEmpty { allProfiles.filter { group.startsWith(it.name) } }
    .ifEmpty { allProfiles.filter { group.commonPrefixWith(it.name).isNotEmpty() } }

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍 updated it e2a725f

@gabrielittner gabrielittner merged commit 93a2188 into main Jan 15, 2023
@vanniktech vanniktech deleted the staging-profile branch January 15, 2023 14:18
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.

Error in publish when profile name does not matches with library group name
3 participants