-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[WIP] Operating System compatibility of tools and actions #11893
Conversation
Generated by 🚫 Danger |
Open questions:
Open TODOs:
|
5daf2cb
to
7792837
Compare
Do we need to have unit tests for this or wait for people to use the respective actions on a Linux machine?
I think that this call: fastlane/fastlane/lib/fastlane/runner.rb Line 315 in 7792837
could be replaced with a call to
I'd say that using
I think there is a way in the fastlane codebase to disable some output during tests, but don't know where I saw it. |
Definitely - but my question referred to the code I wrote for
But those are good questions as well. In general we assume that the fastlane codebase is fully covered with tests, and as almost all tests are passing on Linux and Windows we could assume that all will be good. But I don't fully trust that yet, which is why I prefer marking both new platforms (Linux, Windows) as Question then is what is enough to set an action to true. Unit tests as you suggest? Actual usage of all parameters? I don't know yet. Suggestions?
That's a good idea. From fastlane_core README:
Here is the actual implementation: fastlane/fastlane_core/lib/fastlane_core/ui/interface.rb Lines 124 to 134 in 41cc295
This might be a nice alternative, that doesn't blame the user for the problem (and probably also doesn't pollute analytics): fastlane/fastlane_core/lib/fastlane_core/ui/interface.rb Lines 167 to 177 in 41cc295
Yeah, that is to harsh in this case. Actions need an |
I'd argue that calling an action on Linux that doesn't support this platform is a user error. It's something that the user is doing while he/she isn't supposed to do so. That's why we also fail early instead of letting it crash. |
Good point, will keep that in mind and do some research what is possible there. |
|
fastlane/lib/fastlane/action.rb
Outdated
@@ -149,5 +149,23 @@ def self.other_action | |||
def self.deprecated_notes | |||
nil | |||
end | |||
|
|||
def self.is_compatible?(operating_system, action_compatibility = {}) | |||
# TODO find way to motivate developer to do so implement `is_compatible` in action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably increase plugin rating if this is defined ^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great idea.
"Linux" => false, | ||
"Windows" => true | ||
} | ||
super(operating_system, compatibility) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to do this without calling super
? I don't think we use super anywhere else so not sure if we want to try and make things consistent when people try to implement them? But I do also like this approach too 🤔
Is it possible to also just do something like...
def self.is_compatible?(operating_system)
[:macos, :windows].include?(operating_system)
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to do this without calling super?
I don't think so as I wanted it to have a "default compatibility" that is present for all actions by default - which would currently be all of them.
(The is_supported?
which we already have and is a bit similar doesn't need that as it was required from the beginning and calling an action without it actually stops execution with an error message)
I actually like this better as this way each action doesn't "replicate" the logic to check - but of course this is only important here as the checking logic is a bit more complicated with the defaults.
Is it possible to also just do something like...
[:macos, :windows].include?(operating_system)
I think using just an array only works for yes/no situations. But be have yes/no/unknown to express that it 1) works, 2) doesn't work or 3) hasn't been explicitly set/tested.
kill functionality on all other OSs (so our detection code gets better)
e8f14bb
to
6d3c02f
Compare
After not actively thinking about this for half a year but testing fastlane on Windows and Ubuntu, I think it might make more sense to simplify this to only add a "setting" to the actions that definitely do not work on a platform. No |
This will not be implemented. |
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validMotivation and Context
Description
closes #11859