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

Automatically update the alpine version with the 2 latest minor versions #92

Conversation

baseballlover723
Copy link
Contributor

This solves part of

# TODO: Automate picking the OS versions
(it only updates alpine at the moment), but it shouldn't be too difficult to expand this to the ubuntu and debian versions.

I think my tests should be good enough to be sure that it works, but I have a hard time figuring out which images will be built in the docker checker job. I did confirm that it does currently return the same @build var at the current time though, so it should behave properly.

Let me know if you like this approach and I can expand this to include debian and ubuntu as well

@baseballlover723 baseballlover723 force-pushed the pr/automate_alpine_versions branch 3 times, most recently from 4d166fc to e0da353 Compare July 9, 2021 17:10
Copy link
Member

@ericmj ericmj left a comment

Choose a reason for hiding this comment

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

Since things break between releases of minor alpine versions I think we should explicitly pick the minor versions and only automatically update the patch version.

lib/bob/job/os_versions.ex Outdated Show resolved Hide resolved
lib/bob/job/os_versions.ex Outdated Show resolved Hide resolved
lib/bob/job/os_versions.ex Outdated Show resolved Hide resolved
lib/bob/job/os_versions.ex Outdated Show resolved Hide resolved
test/job/os_versions_test.exs Outdated Show resolved Hide resolved
test/job/os_versions_test.exs Outdated Show resolved Hide resolved
@baseballlover723 baseballlover723 force-pushed the pr/automate_alpine_versions branch 2 times, most recently from 617ca53 to 70ad17d Compare July 12, 2021 05:34
@baseballlover723
Copy link
Contributor Author

@ericmj I haven't finished all of the changes yet, but pushed up some of the changes you requested. I'm not quite sure how much I like a OSVersions.select_os_versions(tags) function. Mostly because then that would imply that we would only call out to OSVersions to get a single OS versions, and not all of them. Feels odd to me to group together the other OS's in another file, though I'm not strictly opposed. Let me know what you think of this, and I'll look to finish this up once I get some more time to work on this.

@baseballlover723 baseballlover723 changed the title automatically update the alpine version with the 2 latest minor versions Draft: automatically update the alpine version with the 2 latest minor versions Jul 12, 2021
@ericmj
Copy link
Member

ericmj commented Jul 12, 2021

I am not sure I follow, why do you need to move it to another file? Right now only alpine is looked up so that's only what you have to test, if ubuntu/debian is added in the future that could be tested as well, possibly by changing the API to select_os_versions("alpine", tags) or select_os_versions(%{"alpine" => tags, "ubuntu" => tags}).

If you would rather mock then please use https://hex.pm/packages/mox instead and create a behaviour for Bob.DockerHub.

@baseballlover723
Copy link
Contributor Author

Sorry for the delay, finally got some time to work on this again. What I meant by needing to move it to another file, is that then you'd need to move Bob.DockerHub.fetch_repo_tags("library/alpine") into the calling file, and that feels wrong to me, since that feels like its part of the responsibility of the OSVersions file (if we did do this, then a better name would be something like OSFilterer). I think maybe the easiest way forward would be to move most of what is currently in OSVersions into a new file OSVersionsSelector and then OSVersions just gets the tags and then gives them to OSVersionsSelector to filter them. Then we can only test OSVersionsSelector without having to mock.

@baseballlover723 baseballlover723 changed the title Draft: automatically update the alpine version with the 2 latest minor versions Automatically update the alpine version with the 2 latest minor versions Jul 26, 2021
@baseballlover723
Copy link
Contributor Author

@ericmj this is ready to be reviewed again

@ericmj
Copy link
Member

ericmj commented Jul 28, 2021

To me it's fine to have public functions in a module even it's only to test them. Personally I would merge OSVersions and OSVersionsSelector, but this is also fine.

Thank you for the PR!

@hoyon
Copy link
Contributor

hoyon commented Aug 9, 2021

Is this ready to be merged? Alpine 3.14.1 has been released and I'm keen to bump our images.

@baseballlover723
Copy link
Contributor Author

@ericmj any reason to not merge this?

@baseballlover723
Copy link
Contributor Author

@ericmj can we merge this? I see that Alpine 3.14.1 and Alpine 3.14.2 have been released and it would be nice to have the next Erlang and Elixir releases to use those newer Alpine versions.

@ericmj
Copy link
Member

ericmj commented Sep 9, 2021

Adding this change would increase the maintenance burden too much since Alpine often make breaking changes. Instead please submit PRs with version updates and the required changes to bob or build logs that show that new versions are compatible with the old.

@ericmj ericmj closed this Sep 9, 2021
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.

3 participants