Skip to content
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 environment label to navbar #1206

Merged
merged 3 commits into from
Jan 20, 2024

Conversation

sparshalc
Copy link
Contributor

This pr addressed #1116 . I have updated the relevant code to ensure that the environment label is visible in the secondary navbar.

image
image

@Pauloparakleto
Copy link
Contributor

@bensheldon This is so usefull for a first version. Sometimes I place development and production together when monitoring the jobs. It can avoid lot of mistakes.
@sparshalc does it also play well in dark mode? I would love to know that.
Thanks!

@bensheldon
Copy link
Owner

I like this in principle, but I think the visual design of it needs some

  • Could you explore a way to fit it into the same horizontal line as the other text in the secondary navbar? Vertical space is at a premium and I want to avoid making those navbars any taller.
  • I'd like to avoid using alert/warning colors for things that are purely informational (even if they should be high-visibility)
  • Another option would be to put this into the Primary Navbar with some sort of icon and an abbreviated environment name (e.g. Prod/Dev/first(3))

@sparshalc
Copy link
Contributor Author

@bensheldon i have pushed the changes you requested.

@Pauloparakleto
Copy link
Contributor

@sparshalc may you please provide the pictures how it is after the updates, thank you a lot. I am eager to use the new version :D

@sparshalc
Copy link
Contributor Author

As per @bensheldon 's suggestion, I have incorporated the environment details into the primary navbar.

image

@bensheldon
Copy link
Owner

I made a few tweaks so it's always visible regardless of viewport. I also swapped it to a globe because ChatGPT made a very convincing, though possibly ridiculous, argument 😆

An appropriate icon to represent the environment (development, staging, production) could be a globe or a world icon. This is because these environments are often associated with different stages of deployment, which can be thought of as different 'worlds'.

Screenshot 2024-01-19 at 4 15 21 PM

Screenshot 2024-01-19 at 4 15 30 PM

@bensheldon bensheldon changed the title Add environment label in secondary navbar Add environment label to navbar Jan 20, 2024
@bensheldon bensheldon added the enhancement New feature or request label Jan 20, 2024
@bensheldon bensheldon merged commit 733f0b1 into bensheldon:main Jan 20, 2024
20 checks passed
@mroach
Copy link

mroach commented Jan 29, 2024

I just saw this change come through in the dependabot changelog. Nice one!

Would you be open to having a way to set/override the source of this label? In our setup, we have 3 Rails envs: development, test, and release. The release env itself runs in different stages, namely: edge, demo, production.
So in our case, Rails.env is always release outside of local dev and testing.

For the one or two places in our app where we want to know what actual stage it's running in, we read the APP_ENV or KUBERNETES_NAMESPACE env var.

What about a config option to allow customising this that would continue to fall-back to Rails.env? Then we could do something like:

config.good_job.environment_label = ->() { ENV.fetch("APP_ENV") { Rails.env } }

Just as I was about to submit this, I saw this comment from the linked issue actually recommended making it customisable. This was a nice approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

4 participants