-
Notifications
You must be signed in to change notification settings - Fork 11
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
Allow seperate app versions under an Umbrella #7
base: master
Are you sure you want to change the base?
Conversation
…ioning Allow seperate app versioning under umbrellas
…ioning Push multiple tags
…ioning Better handling of multiple tags
…ioning Use correct nested change descriptions
Hi! Would it be OK to merge this PR? That's pretty much exactly what I need in my project 😊 Cheers! |
I would be happy to, but I do not maintain the repo |
@Theuns-Botha Yeah I know. While we wait, do you mind if I actually write a couple comments on your code? I was looking at it and I have a couple suggestions. |
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.
I wrote some comments on the code, just mainly thoughts while this PR isn't merged. Let me know what you think, I find it interesting to look at how we can make the solution even better :)
Do you think we should also add tests to your code ?
end | ||
end | ||
|
||
defp bump_multiple() do |
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.
It could make sense to try to split this one into smaller functions so that it's a bit more understandable what it does, wdyt ?
{:ok, sub_apps} -> | ||
sub_apps = Map.put(sub_apps, :umbrella, ".") | ||
|
||
changes = Enum.map(sub_apps, fn | ||
|
||
{:umbrella, app_path} -> | ||
# Note changes re required for the umbrella app | ||
{current_version, new_version, changelog_entries} = get_changes(app_path, :normal) | ||
{:umbrella, app_path, current_version, new_version, changelog_entries} | ||
|
||
{app, app_path} -> | ||
|
||
say "\n\n==============================================" | ||
say "Bump details for #{Atom.to_string(app)}" | ||
say "==============================================" | ||
|
||
get_changes(app_path, :multi) | ||
|> case do | ||
nil -> nil | ||
{current_version, new_version, changelog_entries} -> | ||
{app, app_path, current_version, new_version, changelog_entries} | ||
end | ||
|
||
|
||
end) | ||
|> Enum.filter(fn(change) -> not is_nil(change) end) | ||
|
||
if allow_changes?(changes) do | ||
make_changes(changes) | ||
end | ||
|
||
{:error, :unknown_app_structure} -> | ||
say "Please note that only standard umbrella app directory structures are supported. Please refer to the documentation for details", :red | ||
end |
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.
I reckon this could be used with a with
statement and relying on pattern matching to do the thing.
umbrella_changes = Enum.find(commit_changes, | ||
fn({app, app_path, current_version, new_version, changelog_entries}) -> | ||
app == :umbrella | ||
end | ||
) | ||
app_changes = List.delete(commit_changes, umbrella_changes) |
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.
This could be combined in a with
No description provided.