-
Notifications
You must be signed in to change notification settings - Fork 274
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
Add require_environment setting #356
Comments
This one seems to have taken a back seat? Should I take this up next? |
@gideondsouza it will be great, if you have the time :) |
hey @mickeyn I am eager to get back on board but I'm a little out of touch (since it's been a while since I last saw the Dancer2 code) I'll look at this today evening, I hope you guys will be open to a few questions 😄 |
Very open! :) |
hey guys. So questions I have are:
? I can check within the loop for the |
@gideondsouza It was merged: PerlDancer/Dancer@b5481de (I haven't looked into the second item yet) |
@xsawyerx @veryrusty @yanick Sorry to poke you guys, what do you think? Should it be implemented here? : Along with the check that the file is readable (I wonder not readable also includes file not available) I will check for |
Makes sense to me. :) |
@gideondsouza are you claiming this issue? Just so we mark it and won't direct anyone else to work on it. |
Yes I am :) On Sunday, June 8, 2014, Sawyer X [email protected] wrote:
|
ok, so I ran into a problem: I tried to implement this feature inside This is when I analysed the code for a bit. The way it's structured here is:
The The problem seems to be that all paths are determined together. This function maybe needs to be split ? So that the default Sorry about the wall of text. I'd like some suggestions, or maybe I missed something here. Please let me know. |
Wall of text is just fine. :) That does sound like a tricky problem. Maybe separating configuration reading from triggers? |
@xsawyerx not sure what triggers are...mind expanding on that? 😃 |
Triggers are configuration options that initiate a subroutine. You can find those here: |
Ah I see. But I'm still not 100% here, I see that the triggers build up these four engines right Or are you referring to the fact that I'm not seeing how the triggers end up calling config role methods and why this is related to the environment setting. |
@xsawyerx ok just to simplify my confusion I'm not seeing where the configuration reading is initiated as part of the triggers? Just poking you guys for good measure too @veryrusty @yanick @mickeyn because I want to get this done :) |
Hey guys, I was out on a little vacation and haven't seen this since. Any updates on this? Could any of you guys give me more clues, tips, suggestions on how to go ahead with this. In the meantime I was thinking of going and looking at any other issues I can tackle. |
Is this still a desired feature? |
PR: #780 |
I'm sorry for all the delays with this ticket. I've been having a lot of thoughts regarding this. I'm thinking of maybe adding this to the concept of a strict mode. Then we could add more types of checks. Then again, this would be separate from a strict mode allowing you to remove old Dancer2 mannerisms in favor of new ones and strictures in the way your application works (expecting an environment file to be available, amongst other checks). Would love to get more feedback about this. |
So, if I could delete all my previous comments on this issue and write this simple thing: Instead, what if we had "include" available as a configuration option, which would require us to include files? We could have it include any number using a glob (any that match) or filenames. If a file is mentioned by name (file-name, get it?), and it doesn't exist, it will crash. We make sure we never read files more than once, so if we already read the environment file (because it existed and we automatically do that), and you mentioned it as an include, it won't be read again. But, if it didn't exist (silently ignoring it), it would now try to find it and fail loudly. This would be a generic solution which could be used not only to solve this problem, but to add additional include files (which we currently don't support). |
I'm very much in favor of an include directive. There are times I wish I could tuck some information away in another file separate from the ones Dancer uses, and I'd like to use them without creating my own YAML/JSON reader every time I need to access them. How would this interact with the notion of 👍 on the include idea though! |
I'm looking at One question, though--there's an ancient note in this sub In
..then in an environment file:
As things are currently, I think that the environment would take precedence, and setting_1 would not be set. By "mergeable", do we mean that in this scenario, both setting_1 and setting_2 should be set? |
That'd be my understanding, yup! ... BWAHAHAHAHA I just scrolled all the way up and realized it's one of my tickets. 😂 Okay, I have to look at what the heck I was thinking about here. |
The conversation moved quite a ways from your original post, @yanick. It kinda pivoted into an enhancement idea for an "include" directive in D2 configurations just a few comments ago, and that's where I am. It looks like your initial request has been done in some way. Everything from Sawyer's comment at #356 (comment) is kind of a different thing, and probably ought to be popped out to its own issue, maybe? |
Config, in general, needs some love. We have a PR #1637 that I am way, way overdue to look at. I'm starting to wonder if we should start grouping all the config issues together and start wading our way through what's best and what's not. |
Port PerlDancer/Dancer#946 to Dancer2
The text was updated successfully, but these errors were encountered: