Skip to content

Build internal links from the running instance so dev and staging don't link to production #11943

Open

Description

@rjsparks

Problem

Many links datatracker builds to its own pages are absolute and always point at production, whatever instance renders them. On dev and staging those links go to datatracker.ietf.org, so they either show production's copy or 404 for anything that only exists on that instance.

For example, on a dev instance, every materials link on a meeting's proceedings page goes to https://datatracker.ietf.org/....

How links are built today

  • Document._get_ref() (behind get_href() and get_versionless_href()) prefixes settings.IDTRACKER_BASE_URL onto any relative format from MEETING_DOC_HREFS, DOC_HREFS and similar settings.
  • IDTRACKER_BASE_URL is set to https://datatracker.ietf.org in ietf/settings.py, and the dev and staging configurations don't override it.
  • IDTRACKER_BASE_URL is also used directly in views, models and email templates. Emails and announcements need absolute URLs, but on dev and staging they should name the instance that sent them.
  • ietf/settings_test.py sets a different IDTRACKER_BASE_URL, and tests compare generated links against get_href() itself, so they don't check which host a link names.

Goal

Links to datatracker's own pages resolve on the instance that produced them: relative where the context allows (pages), and absolute with a per-instance base URL where it doesn't (email, feeds, API responses, OIDC claims).

Needs careful analysis

Some behaviour works today only because links point at production. Clarifying the logic must not quietly break those cases:

  • Dev and staging pages currently "work" because production has the content. Instance-relative links will expose data a dev or staging database doesn't have; decide whether that is the desired behaviour or needs a fallback.
  • Absolute links are stored in cached content, for example proceedings content cached under a frozen key once proceedings are finalized, and agenda data. Changing how links are built needs a cache refresh plan.
  • External consumers receive these URLs (the RPC API, OIDC userinfo, emails, feeds). Check which of them need absolute URLs and which host each should name.
  • Some formats are already absolute, for example bluesheets, which always link to www.ietf.org. Decide whether they are in scope.
  • Add tests that check the host of generated links.

Related: removing the pre-Cloudflare CDN settings (filed alongside this), which also decide where some links point.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions