Allow seperate app versions under an Umbrella#7
Allow seperate app versions under an Umbrella#7Theuns-Botha wants to merge 12 commits intolm-pretorius:masterfrom
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. |
bdubaut
left a comment
There was a problem hiding this comment.
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.
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.
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) |
No description provided.