Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Allow override of bundler version or resolve from lock file #114

Merged
merged 42 commits into from
Jul 3, 2022

Conversation

inverse
Copy link
Contributor

@inverse inverse commented Jan 21, 2022

Allow override of the default provided bundler from the image or resolve from Gemfile.lock if one exists.

entrypoint.sh Outdated Show resolved Hide resolved
@inverse inverse changed the title Allow override of bundler version Allow override of bundler version or resolve from lock file Jan 28, 2022
@inverse
Copy link
Contributor Author

inverse commented Mar 7, 2022

@helaili anything you would change on this?

@inverse
Copy link
Contributor Author

inverse commented Mar 21, 2022

@helaili any other feedback?

@helaili
Copy link
Owner

helaili commented Apr 1, 2022

Sorry @inverse, time is a scarce resource.
Would you mind adding a test case similar to this one?

@inverse
Copy link
Contributor Author

inverse commented Apr 19, 2022

@helaili I added two cases cases where it would do what you outlined - I think it's correct?

I also added asserting the bundler version matches either explicitly or from the lockfile.

Copy link
Owner

@helaili helaili left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @inverse. I have only reviewed the test generation so far but I'd like it to be properly run before I review the rest of this PR.

.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
inverse and others added 6 commits April 30, 2022 20:43
Co-authored-by: Alain Hélaïli <helaili@github.com>
Co-authored-by: Alain Hélaïli <helaili@github.com>
Co-authored-by: Alain Hélaïli <helaili@github.com>
Co-authored-by: Alain Hélaïli <helaili@github.com>
Co-authored-by: Alain Hélaïli <helaili@github.com>
Co-authored-by: Alain Hélaïli <helaili@github.com>
inverse and others added 12 commits April 30, 2022 20:44
Co-authored-by: Alain Hélaïli <helaili@github.com>
Co-authored-by: Alain Hélaïli <helaili@github.com>
Co-authored-by: Alain Hélaïli <helaili@github.com>
Co-authored-by: Alain Hélaïli <helaili@github.com>
Copy link
Owner

@helaili helaili left a comment

Choose a reason for hiding this comment

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

Tests are not passing

.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
inverse and others added 2 commits May 2, 2022 22:10
Co-authored-by: Alain Hélaïli <helaili@github.com>
@helaili
Copy link
Owner

helaili commented May 3, 2022

Tests are still failing. Trying to debug it, I've seen this line.

Thing is bundler is being installed within the container, and the echo "::set-output name=value::$(bundler -v | cut -c 16- | xargs)" command is being called within the next step, so outside of the container where bundler is not installed or could be a totally different one.

You need to run the set-output command from entrypoint.sh and referred to the value as coming from the run step. This step should actually be renamed for clarity.

@inverse
Copy link
Contributor Author

inverse commented May 3, 2022

Ahh you're totally right 🙈

You need to run the set-output command from entrypoint.sh and referred to the value as coming from the run step. This step should actually be renamed for clarity.

What do you mean by that? I don't follow?

I pushed a change which instead does the following:

  • Adds the bundler version to site config and exposes it on the page
  • Modifies the cypress tests for the two additional flows to assert the bundler version

image

Copy link
Owner

@helaili helaili left a comment

Choose a reason for hiding this comment

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

I think it's getting closed. We can unfortunately publish and test in sequence as there is only one published site at a time, so the publish needs to happen after the last test and then we run the test.

.github/workflows/test.yml Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
inverse and others added 3 commits May 9, 2022 21:12
Co-authored-by: Alain Hélaïli <helaili@github.com>
Co-authored-by: Alain Hélaïli <helaili@github.com>
@inverse
Copy link
Contributor Author

inverse commented May 9, 2022

@helaili good catch! how does the graph look now? https://github.com/helaili/jekyll-action/actions/runs/2296309955

@helaili
Copy link
Owner

helaili commented May 10, 2022

The graph is good now but the test is still failing
works (failed)

@inverse
Copy link
Contributor Author

inverse commented May 10, 2022

@helaili I think I know why...

So this test case is when we force install a newer version of bundler than what the application is bundled with. Yet the system has 2.1.4 so it bundles with that version as it's in the lockfile :/

Not sure what a good test would be for this case? We would need to some how remove the system bundler version before for that test?

I could remove that part and we just install the bundler version from the lockfile which probably covers the majority of cases...

@helaili
Copy link
Owner

helaili commented Jul 3, 2022

I'm removing the Gemfile.lock file during the jekyll_bundler_run job so that it is generated with the right Bundler version. I'm also now relying on the bundle -v command as opposed to bundler -v to figure out the version number as `bundler is not in the path in this specific case.

Thanks for this contribution @inverse

Tested in #132

@helaili helaili merged commit b263bd6 into helaili:master Jul 3, 2022
@inverse
Copy link
Contributor Author

inverse commented Jul 3, 2022

@helaili That's for taking the time to explain 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants