-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Document why using Arkana in a Build Phase Run Script is discouraged #18
Comments
Hello @rogerluan, I've been looking at #17 and wondered… would it be possible to add a build phase to check that Arkana has been run manually at least once, otherwise trigger a build failure with a message prompting the developer to run Arkana first? Something similar to what CocoaPods do when it detects an inconsistent or missing Podfile.lock and triggers a build failure for the developer to run If a build phase like this is possible, I think it would fit as part of the documentation about using Arkana as a build phase. |
Hi @alobaili 👋 yes, that's possible!
This would guarantee that if you've never run arkana before, or if the config file changed since your last run, you'd have to run again. However, it could create a false expectation that it would have to be triggered when an env var ( If you're seeking solely the "never run" scenario, you could add a Run Script like: if [ ! -f "$SRCROOT/dependencies/ArkanaKeys/Sources/ArkanaKeys.swift" ]; then
# print error to STDERR
echo "error: ArkanaKeys has never been run. Please run 'bundle exec arkana [your options here]' and try again." >&2
exit 1
fi |
@alobaili did the solution above solve your issue? |
@rogerluan I haven't used Arkana yet. I was actually evaluating migrating from CocoaPods Keys to Arkana when I wrote my original comment and discussing using it with my team. It may take some time before I use it. Your comment also opened my mind to the other two use cases that the run script doesn't cover. Once I give it a try I will share my experience. |
@alobaili ah, got it! Just wondering, could you remind me of how CocoaPods Keys handles those scenarios, or, alternatively, how you and/or your team consumes CocoaPods Keys so that these limitations we just discussed aren't a problem in CocoaPods Keys? 🙏 |
I'm not sure about the technical details, but When a developer joins a project he clones the repo and installs CocoaPods and Cocoapods Keys. The first Each time the keys are chaged by the developer and a build is attempted, a build error occurs asking the developer to run Each developer is responsible for entering the correct keys and running The main reason why I looked at Arkana is that i was looking for a solution that is supported by SwiftPM. |
Got it. By your description and what I remember of CocoaPods Keys, if a developer changes the env var value (not add/remove/rename keys, but simply change the value of an existing key), then no one is informed (Podfile.lock is not updated), and the rest of the team will remain unaware of those changes if the given developer doesn't let them know and ask them nicely to update the env var values in their machines... Arkana will not only add support to SPM for you, but it will also allow you to share a secret With that being said, the script snippet I sent you earlier should help solve the specific pain problem you pointed, but wouldn't solve for this one:
To solve for this, a new feature will need to be implemented like the one I mentioned earlier 🙇 I will think about ways to implement this and will keep you posted. But don't expect a timeline as I only work on this project during rare spare time (for the time being) 🙏 Any input/feedback/ideas/suggestions are more than welcome! Let me know if your team ends up adopting Arkana and if there are any trouble integrating it. 💪 |
I created a separate issue to keep track of this new feature #20 🙏 |
Thank you @rogerluan I really appreciate your time in this discussion. I hope it will lead to a creative solution to these problems. I'm looking forward for a future where this particular problem finds a suitable solution in Arkana. And please do take all the time needed. Thanks again. |
Relates to #17
The text was updated successfully, but these errors were encountered: