tilt-dev / tilt

Define your dev environment as code. For microservice apps on Kubernetes.
https://tilt.dev/
Apache License 2.0
7.67k stars 301 forks source link

View for only (global) logs #5381

Open colelawrence opened 2 years ago

colelawrence commented 2 years ago

Describe the Feature You Want

I have added some neat buttons to my tilt configuration, and I want to comfortably observe/focus on the results of clicking those buttons.

Current Behavior

As I understand it, the only way to view the logs from things like ~local_resource~ (edit: I'm not actually sure what this is called) commands, are to open the All Resources page, which is overwhelmed by other garbage reported from my services (something I can't control the output of).

This leads to a very confusing and disgusting experience where I want to just run something like a migration revert or a code generation, but I may very easily miss an error that occurs when these are run.

Why Do You Want This?

Additional context

This potentially has overlap with https://github.com/tilt-dev/tilt/issues/1815 (but that feature looks a little more comprehensive, and has been around for a while). Perhaps this pain point would be addressed by the mentioned feature, but that doesn't do us much good if that feature remains in a design-consensus phase. So, I'm suggesting that there must be some way to do something simpler in order to relieve this major pain point.

About us:

nicks commented 2 years ago

re: "As I understand it, the only way to view the logs from things like local_resource commands, are to open the All Resources page"

This is...surprising news to me. Usually:

so I wouldn't expect you'd have to go to the All Resources page? so maybe there's a bug here? how are you setting the buttons up?

colelawrence commented 2 years ago

@nicks this is a great clarification. I'm certainly likely to be using terminology wrong.

I have buttons set up like so:

cmd_button('code:generate',
    argv=['sh', '-c', 'ACCT_SCHEMA=$AGS RUNTIME_SCHEMA=$RGS WEB_UI_GQL=$WGC bash ./tilt/buttons/code-generate.bash'],
    location=location.NAV,
    icon_svg=gql_gen_icon,
    text='Generate Code',
    inputs=[
        bool_input('AGS', label='Account GQL Schema', true_string='1', false_string=''),
        bool_input('RGS', label='Runtime GQL Schema', true_string='1', false_string=''),
        bool_input('WGC', label='web_ui GQL clients', true_string='1', false_string=''),
    ]
)

This button takes about 80s and as I understand it, I can only access the logs from the "All Resources" page.

I've taken a short recording for you and your team to gain a better idea of the difficulty I'm trying to overcome.

Loom "2022-01-15 Tilt logging for buttons UX concerns context" 4 min

image
nicks commented 2 years ago

cc @milas (who's on bug rotation) - thanks for the details!

ya, I think there's a couple small improvements we should make here that would make this a lot better:

milas commented 2 years ago

@colelawrence The uibutton extension has been updated with both the improvements Nick suggested above.

If you rm -rf ./tilt_modules/uibutton in your project, the new version will get fetched on next startup and your nav button logs will start showing up in the (Tiltfile) resource by default.

Let me know if you have any issues!

colelawrence commented 2 years ago

I'll try it out, today! That sounds like a big step up for us. Thanks

colelawrence commented 2 years ago

@milas – It's looking good, the only thing I notice is that the notification after clicking the button still takes you to Global Logs, when it could take you to (Tiltfile) logs.

Definitely a step up, though!

image
milas commented 2 years ago

Ah, thanks for pointing that out! I'll tweak the web UI and close this issue out after that's done 🙂