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

Allow seperate app versions under an Umbrella #7

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

Theuns-Botha
Copy link

No description provided.

@bdubaut
Copy link

bdubaut commented Mar 10, 2021

Hi! Would it be OK to merge this PR? That's pretty much exactly what I need in my project 😊

Cheers!

@Theuns-Botha
Copy link
Author

Hi! Would it be OK to merge this PR? That's pretty much exactly what I need in my project blush

Cheers!

I would be happy to, but I do not maintain the repo

@bdubaut
Copy link

bdubaut commented Mar 16, 2021

@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.

Copy link

@bdubaut bdubaut left a 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
Copy link

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 ?

Comment on lines +28 to +61
{: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
Copy link

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.

Comment on lines +50 to +55
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)
Copy link

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

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.

2 participants