Skip to content

[NI][Plugins] Derive Glean Server URL from work email in setup#9

Open
pragati-agrawal-glean wants to merge 1 commit into
mainfrom
email-based-server-url-setup
Open

[NI][Plugins] Derive Glean Server URL from work email in setup#9
pragati-agrawal-glean wants to merge 1 commit into
mainfrom
email-based-server-url-setup

Conversation

@pragati-agrawal-glean

Copy link
Copy Markdown

setup now accepts a work email and resolves the Server (QE) URL via the public config/search endpoint, instead of requiring the admin-only about-glean URL. Falls back to manual server_url entry when the domain isn't recognized; multi-tenant deployments resolve correctly.

Bumps esbuild->0.28.1 and pins vite->7.3.5 (overrides) to clear CVE blocks that prevented the build from installing.

setup now accepts a work email and resolves the Server (QE) URL via the
public config/search endpoint, instead of requiring the admin-only
about-glean URL. Falls back to manual server_url entry when the domain
isn't recognized; multi-tenant deployments resolve correctly.

Bumps esbuild->0.28.1 and pins vite->7.3.5 (overrides) to clear CVE
blocks that prevented the build from installing.
Comment thread src/index.ts
Comment on lines +257 to +263
"stages: (1) resolve and save the Server URL, (2) authenticate, " +
"(3) fetch the remote tool catalog. Call with no arguments to advance " +
"through the next missing stage. Call with email to look up and " +
"configure your Glean instance automatically (the normal path). Call " +
"with server_url to set the Server URL directly (fallback when the " +
"email domain isn't recognized). Call with callback_url to finish " +
"authentication after a sign-in paste. Call with reset=true to clear " +

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you test once with a dumber model like Sonnet with medium thinking to make sure it follows all these cases:

  1. Email + Auth + Reset
  2. Wrong email + wrong server url + correct server url + auth + reset
  3. Wrong email + correct server url + auth + reset

Comment thread src/index.ts
Comment thread src/index.ts
`Invalid URL: "${rawUrl}". Please provide the Server instance (QE) URL ` +
`from https://app.glean.com/admin/about-glean ` +
`(e.g. https://acme-be.glean.com).`,
`(e.g. https://acme-be.glean.com), or pass your email instead.`,

@eshwar-sundar-glean eshwar-sundar-glean Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#clarify
any reason to remove this line from https://app.glean.com/admin/about-glean

@pragati-agrawal-glean pragati-agrawal-glean Jun 19, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is removed because this link was admin-only, so the two available options are 1. to provide the qe-url directly (if they have) or give their email. The link is shown if they reach the fallback path (line #75). As per #9 (review), would show it only when email path does not work

Comment thread src/config-search.ts

const CONFIG_SEARCH_URL = "https://app.glean.com/config/search";

// Mirrors com/askscio config_endpoint DeploymentConfig.

@eshwar-sundar-glean eshwar-sundar-glean Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#suggest
We may / may not accept contributions, its good to keep the repo self contained to public code and not reference implementation details / names from internal code base

Comment thread src/config-search.ts
Comment on lines +79 to +83
// Unknown domains aren't an error here — the endpoint returns the shared
// central URL with isMultiTenant=false. Reject that so a typo doesn't
// silently point at the central endpoint (the user can still use
// server_url). Multi-tenant customers legitimately have queryURL ===
// centralURL but with isMultiTenant=true, so accept those.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clarify, what do you mean by this
Reject that so a typo doesn't
// silently point at the central endpoint (the user can still use
// server_url)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So for customers whose isMultiTenant is true, it means they do not have a dedicated URL for them and are still on queryURL = centralURL = https://apps-be.glean.com/ . The comment here says that if someone does a typo in the email domain, that should not connect it to the centralURL but creates an error.

@mohit-gupta-glean mohit-gupta-glean left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#suggest Can we get rid of the fallback flow and simplify. We should document the server URL flag instead (in README, not in user journey). No point in complicating the setup and the fallback path anyway won't work for majority of users as they are not admins.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rebase to latest master. The codex file is gone.

Comment thread src/config-search.ts
Comment thread src/index.ts
`To connect this plugin to your Glean instance:\n` +
`To connect, either:\n` +
`- enter your work email (e.g. you@acme.com) and we'll find your Glean instance automatically, or\n` +
`- enter your Glean Server (QE) URL directly, if you have it.\n\n` +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#suggest can we not talk about the URL flow if email works. That means that only show this if email does not work for some reason.

Comment thread src/index.ts

// Shown when an email's domain can't be resolved to a Glean instance. Falls
// back to the original manual method.
const MANUAL_URL_FALLBACK_TEXT =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#suggest Let's also add an option to try again with valid email to correct for typos.

Comment thread src/index.ts
Comment thread src/index.ts
Comment thread src/index.ts
type: "string",
description:
"Your work email (e.g. you@acme.com). Used to look up your " +
"Glean Server instance (QE) URL automatically. Preferred over " +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very confusing. Here, we are saying preferred over server_url and then in server_url, we are saying "takes precedence over email".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants