More prominent indicator that Anonymous Apex/SOQL is not on the project org

Issue #1773 new
Aidan Harding created an issue

I frequently use a project from a sandbox org to run queries or even anonymous Apex on production. Since they have the same “shape”, it’s convenient to have auto-complete work without having to download the production metadata into its own project.

However, since the queries and Apex persist between sessions (which is a great feature) sometimes I run things against production without properly looking at which org is selected.

Would it be possible to put some sort of coloured indicator next to the org name if it’s not the one linked to the project?

Comments (3)

  1. Scott Wells repo owner

    Aidan, I think it's reasonable to have a clear visual cue that the selected connection isn't a project connection. However, are you aware of the "sacred connection" feature where you can designate a connection as requiring confirmation before any (potential) write action occurs against it? That includes obvious actions like deployment but also Anonymous Apex execution. I would certainly recommend enabling that for any production connections, 1GP packaging org connections, etc.

  2. Aidan Harding reporter

    Hi Scott,

    Thanks for getting back so fast.

    Good call on the protected connections... I often add connections via the terminal and then get them into IC by just updating the list. So I tend to bypass protecting a connection. Obviously, I can do it later and maybe I should.

    The related use-case, where protected connections wouldn’t help, is where my project is a scratch org and I’m poking at a sandbox via Anonymous Apex or SOQL. Again, I can confuse myself by targeting the wrong thing, but this time the second connection probably shouldn’t be protected.

  3. Scott Wells repo owner

    Makes sense. I'm still trying to figure out exactly how to distinguish between project and non-project connections in the drop-downs so that it's not noisy or obnoxious, but this is on my short list. I agree that knowing whether you have a project connection selected or not at a glance is quite useful.

  4. Log in to comment