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

fix GLI usage breaking faraday >= 2.7.0 #434

Merged
merged 1 commit into from
Nov 29, 2022

Conversation

blowfishpro
Copy link
Contributor

@blowfishpro blowfishpro commented Nov 27, 2022

when using include at the top level, the module gets included in the Object class

Faraday::Middleware checks whether it responds to on_error, which then finds GLI's on_error, which has a different signature and meaning

this resolves that by wrapping the entire CLI in a class so that GLI::App is not included in Object

we also use GLI's built-in commands_from method to avoid having to reference every command file individually

Resolves #433

Note: The slack:web:api:update task seemed to want to pull in some new stuff - since that usually seems to be done separately I have intentionally excluded that but can include it if you want

@blowfishpro blowfishpro force-pushed the FixFaradayIncompatibility branch from be86f7a to f41c529 Compare November 27, 2022 23:51
Copy link
Collaborator

@dblock dblock left a comment

Choose a reason for hiding this comment

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

These files are auto-generated to keep up with the API, so you want to modify the .erb template and re-generate them, not delete the template. You can do a 1-time update separately so that we can have something clean for this PR, let's start there?

@blowfishpro
Copy link
Contributor Author

That's what I did, I just did it while the code to update the submodule was commented out.

What documentation updates are required when new API features are pulled in? I don't really understand the scope of changes that come with updating the submodule.

@dangerpr-bot
Copy link

dangerpr-bot commented Nov 28, 2022

1 Warning
⚠️ There're library changes, but not tests. That's OK as long as you're refactoring existing code.

Generated by 🚫 Danger

Copy link
Collaborator

@dblock dblock left a comment

Choose a reason for hiding this comment

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

Looks good! Danger complained re:CHANGELOG format, could you please fix and I'll merge?

CHANGELOG.md Outdated Show resolved Hide resolved
@dblock
Copy link
Collaborator

dblock commented Nov 28, 2022

What documentation updates are required when new API features are pulled in? I don't really understand the scope of changes that come with updating the submodule.

Only CHANGELOG. You can leave that alone for now.

when using include at the top level, the module gets included in the Object class

Faraday::Middleware checks whether it responds to on_error, which then finds GLI's on_error, which has a different signature and meaning

this resolves that by wrapping the entire CLI in a class so that GLI::App is not included in Object

we also use GLI's built-in commands_from method to avoid having to reference every command file individually
@blowfishpro blowfishpro force-pushed the FixFaradayIncompatibility branch from f41c529 to 1ab48c2 Compare November 29, 2022 03:16
@blowfishpro
Copy link
Contributor Author

Fixed!

@dblock dblock merged commit 97abb0e into slack-ruby:master Nov 29, 2022
@dblock
Copy link
Collaborator

dblock commented Nov 29, 2022

FYI I decided to rename CLI to Cli in #435. LMK if you think it's a bad idea.

@blowfishpro blowfishpro deleted the FixFaradayIncompatibility branch November 30, 2022 00:52
@blowfishpro
Copy link
Contributor Author

I'm pretty indifferent on that particular point as long as it's consistent.

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.

Incompatibility between Faraday >= 2.7.0 and bin/slack script including GLI::App at the top level
3 participants