-
Notifications
You must be signed in to change notification settings - Fork 32
Feature Request: Add optional debug=port parameter #172
Comments
I know of plenty of people who'd find this useful! Can you think of a way to structure it so we could add different flags? For example, I could see it being useful to add log leveling flags to some services, or specify a different port. |
After looking through our If we only want to support adding flags to the launch step, I believe we could structure it as follows:
The rationale here is that options can be supplied in a variety of ways depending on the program. Some might make their options be accessed with Since every application is different, and the user who is changing them knows how the options should be supplied (as that's what they had to manually change in With the above structure, we save developer time by allowing them to dynamically change what options they are starting their service with, as well as saving edward development complexity by not having to worry about the complexity that comes with determining how to supply options to go/java/docker programs at runtime. If we want to support adding flags to all of steps/commands (i.e. build/launch/stop/etc), I believe we could structure it as follows:
I.e. Edward will parse out the command1/command2 and associate the options to their respective steps. |
Nice! This could also be represented as something like: How would we determine the position in the launch command where we would inject the options? Some flag parsers require specific flags to appear before a command or argument. |
That definitely looks cleaner, but I worry that as the number of options passed in rises, users may not appreciate having to retype Re: How to determine where to inject options? I think a fair solution to this would be to make it as intuitive to users as we can. I believe we should place the options from left to right as they were written in the If the flag parser required a flag to appear before another one, edward would print the error message and the user who entered the command will know that they have to move the options around immediately. They will figure out the order from the error message. Users can be confident that the order of which the options were written out in, will be the same order edward will pass the options to the program. If we tried to solve it any other way and got the automatic re-ordering wrong, then users will have a bad experience. They will be able to move the options around, but because of our automagic re-ordering rules, edward will still supply the options in the same incorrect re-order. Moreover, it's pretty difficult to come up with option re-ordering rules as different programs/ flag parsers have their own specific rule set, and what may work for one set of programs may not work for another. |
The ordering problem isn't limited to the parameters the user is entering. For example: |
That's a pretty difficult problem. The way that i see it is that, the current launch path already has an arbitrary number of parameters. We want Edward to support injecting an arbitrary number of parameters. Which means we want edward to be able to generate combinations that look like
The problem that I'm having is that it's hard to figure out what kind of assertions I can make about the parameters. I.e. If $A2 is a file or directory, then can I be certain that $B2 which a log command must be inserted before $A2 always? Do you have any advice on how to come up with these kinds of assertions? |
The problem space for all possible command structures is pretty large, so I think we might be making a rod for our own back if we try to create specific "rules" around where to put types of parameters. What if the person creating the edward config could specify where to put particular params? Then if you need to add a param in the edward.json file to support debugging, you can commit your change to make the next person's life easier. |
That's a pretty neat approach! How would you recommend someone add a param? If I'm understanding the approach correctly, in the launch step we could have something like:
However, I'm curious about how we should structure the default_value? One thought I had would be to have a null value like |
Going in the right direction, but I think we may need to wrap the whole option, since some flag parsers only allow "-d __" or "--debug __" without the = to join them together. We probably need something to wrap the whole placeholder, like:
|
Hi,
My regular development flow when working on debugging services follows something like this.
~/repo/edward.json
--debug y
inside the launch stepedward start service
If it's possible, I think something like this would be more ideal.
edward start service debug=y
The benefits of this change:
edward start/restart service
The text was updated successfully, but these errors were encountered: