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

action.yml compliance #29

Merged
merged 11 commits into from
Jan 15, 2020
Merged

action.yml compliance #29

merged 11 commits into from
Jan 15, 2020

Conversation

chabad360
Copy link
Contributor

This will make the image-actions action compliant with the current GitHub Actions action.yml format for describing actions.

This will also make the action easier to configure.

@benschwarz
Copy link
Member

Hey @chabad360 - Introducing this change will break all existing config files silently.

To be able to action this we'd need a guide to explain how to make the change and ensure that we didn't break existing configs. Have you thought about how that change might be introduced?

What benefits are there in changing to actions.yml? It's neither required or enforced so the change seems semantic more than anything else.

@chabad360
Copy link
Contributor Author

chabad360 commented Nov 26, 2019

Hey @chabad360 - Introducing this change will break all existing config files silently.

Admittedly, I shouldn't have broken existing custom configs (in my defense, it would still just fall back to the existing defaults). I'll force-push non-breaking functionality in the near future.(I've since done that)

What benefits are there in changing to actions.yml? It's neither required or enforced so the change seems semantic more than anything else.

As to why? Well, using an action.yml is enforced for all new releases (I discovered this the hard way), it's also possible that GitHub may at some point get rid of all non-compliant actions. Also, the current form of configuration is counter-intuitive.

@lannonbr
Copy link

lannonbr commented Dec 2, 2019

In GitHub's changelog, @chabad360 is correct that this is a requirement now: https://github.blog/changelog/2019-10-10-the-github-actions-marketplace-now-requires-an-actions-metadata-file/

@benschwarz
Copy link
Member

Thanks for the heads up @lannonbr. We wrote the action long before actions.yml was a concept and GitHub didn't do a super job of alerting beta users to updates like this one.

We'll review this PR and move to get it merged. 👍

@chabad360, is this ready for review from your perspective?

@chabad360
Copy link
Contributor Author

chabad360 commented Dec 3, 2019 via email

README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
src/config.js Outdated Show resolved Hide resolved
src/constants.js Outdated Show resolved Hide resolved
src/constants.js Outdated Show resolved Hide resolved
src/constants.js Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
Copy link
Member

@benschwarz benschwarz left a comment

Choose a reason for hiding this comment

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

I've left a bunch of questions, comments and required changes. Otherwise this doesn't seem too far off ready to go.

chabad360 and others added 3 commits December 2, 2019 22:58
Co-Authored-By: Ben Schwarz <ben@calibreapp.com>
@chabad360
Copy link
Contributor Author

I made some changes, have a look.

@pelikhan
Copy link

pelikhan commented Dec 4, 2019

Is this a breaking change? Will existing actions fail or silently fail?

@chabad360
Copy link
Contributor Author

chabad360 commented Dec 4, 2019 via email

@lannonbr
Copy link

lannonbr commented Dec 5, 2019

The only thing is if someone uses the custom image-actions.yml file for the config of this action, it will no longer use those custom fields and fallback to the defaults unless they transfer to using the parameters inside the workflow using the with key. So I would maybe either add something in a changelog to explain how to upgrade, or include both the with and the image-actions.yml support for custom arguments

@chabad360
Copy link
Contributor Author

chabad360 commented Dec 5, 2019

The only thing is if someone uses the custom image-actions.yml file for the config of this action, it will no longer use those custom fields and fallback to the defaults unless they transfer to using the parameters inside the workflow using the with key.

It's actually the opposite, and if you were to use both image-actions.yml and the with key, it will use the former since the with key is set as the fallback.

This would similarly be the case if we implement what I suggest here (I'm strongly considering doing it).

Basically, I intend not to have any breaking changes with this PR, as that would be a really bad idea...

However, your point about documenting the change better (i.e. making it clear the there are no breaking changes) is true, and I will try to get to that tomorrow. Update: Done.

Copy link
Member

@benschwarz benschwarz left a comment

Choose a reason for hiding this comment

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

Thank you for your patience @chabad360 — I've left a final round of review.

By making these changes we're essentially deprecating the pre-existing configuration method, but it should lead to more clarity overall. 👍 👍 Well done! 🎉

README.md Outdated Show resolved Hide resolved
src/config.js Outdated Show resolved Hide resolved
src/constants.js Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
@alexdupre
Copy link
Contributor

BTW, most of the settings in image-actions.yml (and also the default set) are already ignored: #39

@chabad360
Copy link
Contributor Author

I believe all is ready!

@benschwarz
Copy link
Member

I created a test repo to take your branch for a spin, but it failed with a missing GITHUB_TOKEN.

Any thoughts @chabad360?

@benschwarz
Copy link
Member

It looks as though github actions read the action.yml file from your branch, but then executed using the prebuilt (@master) docker image.

@chabad360
Copy link
Contributor Author

chabad360 commented Jan 14, 2020

It looks as though github actions read the action.yml file from your branch, but then executed using the prebuilt (@master) docker image.

Yup, that would definitely be why...
The reason for that is quite simple, my actions.yml file is set to use your image (obviously), but I've tested my changes here (Note that this also tests #30).

@benschwarz
Copy link
Member

If you wouldn't mind the additional commits, it'd be useful to see if github are doing any docker caching. If not we'll have to continue to pre-build @master for image-actions releases. 😒

chabad360 added a commit to chabad360/image-actions that referenced this pull request Jan 14, 2020
@chabad360
Copy link
Contributor Author

chabad360 commented Jan 14, 2020

I've just updated my previous comment (spoilers: use the yaml-test branch).

it'd be useful to see if github are doing any docker caching

To my knowledge, nope.

If not we'll have to continue to pre-build @master for image-actions releases.

Well, it's automatic anyways and is definitely the most practical option (better than caching, I think), but it would be nice if we could just use the GitHub Package Registry for that (sadly, we can't).

@chabad360
Copy link
Contributor Author

Aaaaaand, it works!!!

chabad360 added a commit to chabad360/image-actions-demo that referenced this pull request Jan 15, 2020
@benschwarz
Copy link
Member

Aaaaaand, it works!!!

Looks like we have a small issue to overcome - the YAML quality number arguments probably need to be parseInt'd before being pushed into sharp. (This is likely a preexisting issue, but I'd love to call this all done and ready!)

@chabad360
Copy link
Contributor Author

chabad360 commented Jan 15, 2020

Now it's working.

the YAML quality number arguments probably need to be parseInt'd before being pushed into sharp.

Yup, that was the issue.
Plus, the action should error out if Sharp has any more errors.

Copy link
Member

@benschwarz benschwarz left a comment

Choose a reason for hiding this comment

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

Thank you for your tireless work on this @chabad360. A huge improvement 🎉 !

@benschwarz benschwarz merged commit f1ea93b into calibreapp:master Jan 15, 2020
@chabad360
Copy link
Contributor Author

Yay!

@chabad360
Copy link
Contributor Author

Now on to #30!

@alexdupre
Copy link
Contributor

If you want to deprecate the old config file I'd say that the new way to specify settings should support all previous settings. Eg. creating progressive jpeg is very important for web images, and the only way to do it currently is via the old config file that is not documented anymore.

@chabad360
Copy link
Contributor Author

@alexdupre How did one configure progressive JPEGs?

@chabad360
Copy link
Contributor Author

@alexdupre What do you think of #44?

@alexdupre
Copy link
Contributor

Not tested, but looks fine.

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

Successfully merging this pull request may close these issues.

5 participants