Skip to content

chore(SREIN-588) Add redirect for *.bugzilla.mozilla.org to bugzilla.mozilla.org#408

Merged
dklawren merged 2 commits into
mozilla:mainfrom
dklawren:srein-588
Oct 28, 2025
Merged

chore(SREIN-588) Add redirect for *.bugzilla.mozilla.org to bugzilla.mozilla.org#408
dklawren merged 2 commits into
mozilla:mainfrom
dklawren:srein-588

Conversation

@dklawren

@dklawren dklawren commented Oct 28, 2025

Copy link
Copy Markdown
Contributor

Refractr PR Checklist

JIRA ticket: [link to relevant JIRA or other system ticket]

When creating a PR for Refractr, confirm you've done the following steps for a smooth CI and CD experience:

  • Have you updated the relevant YAML in the PR?
  • Have you checked the relevant YAML for any possible dupes regarding your domain?
  • Have you checked if there are any TLS cert concerns - e.g. if the domain being redirected already exists, and it is being changed to point at refractr, is a temporary TLS 'outage' while waiting for certification via HTTP challenge okay? If not, add a note to the JIRA ticket.
  • If desired, have you generated the nginx config manually to confirm updates work as expected?

After PR merge, next steps include:

  • A merge to the main branch will automatically deploy refractr's stage environment -- deploying the prod environment requires a GitHub release to be created.
  • Once deployed, refractr's certmap must be updated and DNS entries must be changed -- SRE can help with this. Please pull someone in on the JIRA ticket or ask for help in #sre on Slack.

@dklawren dklawren requested a review from a team as a code owner October 28, 2025 16:54

@bkochendorfer bkochendorfer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it has to be approved to run the tests. Lets make sure the tests pass first.

@bkochendorfer

Copy link
Copy Markdown
Member

Tests are failing:

$ poetry run doit test
.  deployed
.  version
.  schema
validating dev-refractr.yml against refractr/schema.json => FAILURE
{'if': '$request_uri ~ ^.*\\.bugzilla.mozilla.org/(.*)$', '.*\\.bugzilla.mozilla.org/(.*)$': 'bugzilla.mozilla.org/$1'} is not valid under any of the given schemas

Failed validating 'oneOf' in schema[2]['properties']['dsts']['items']:
    {'oneOf': [{'$ref': '#/defs/dst-redirect'},
               {'$ref': '#/defs/dst-rewrite'},
               {'$ref': '#/defs/dst-headers'}]}

On instance['dsts'][0]:
    {'if': '$request_uri ~ ^.*\\.bugzilla.mozilla.org/(.*)$',
     '.*\\.bugzilla.mozilla.org/(.*)$': 'bugzilla.mozilla.org/$1'}
TaskFailed - taskid:schema
Python Task failed: '<function task_schema.<locals>.schema at 0x7b31aadc7640>' returned False

I think this is probably more accurate and the tests pass:

$ git diff prod-refractr.yml
diff --git a/prod-refractr.yml b/prod-refractr.yml
index 8b36515..fe111ea 100644
--- a/prod-refractr.yml
+++ b/prod-refractr.yml
@@ -856,8 +856,8 @@ refracts:
 
 # SREIN-588
 - dsts:
-  - if: '$request_uri ~ ^.*\.bugzilla.mozilla.org/(.*)$'
-    .*\.bugzilla.mozilla.org/(.*)$: bugzilla.mozilla.org/$1
+  - if: '$request_uri ~ ^/(.*)$'
+    ^/(.*)$: bugzilla.mozilla.org/$1
   - redirect: bugzilla.mozilla.org/
   srcs:
   - '*.bugzilla.mozilla.org'

This generates an nginx block like the follow

server {                                                                        
    server_name *.bugzilla.mozilla.org;                                         
    add_header Strict-Transport-Security "max-age=60; includeSubDomains" always;
    if ($request_uri ~ ^/(.*)$) {                                               
        rewrite ^/(.*)$ https://bugzilla.mozilla.org/$1 permanent;              
    }                                                                           
    return 301 https://bugzilla.mozilla.org$request_uri;                        
}                                                                               

@bkochendorfer bkochendorfer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please update and run tests locally

- I had to update validate.py to work with Python 3.14
@dklawren dklawren merged commit efd341f into mozilla:main Oct 28, 2025
@dklawren dklawren deleted the srein-588 branch October 28, 2025 20:26
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.

2 participants