From 30964aefb2869e55d85758a14a01d0c1bed4dae5 Mon Sep 17 00:00:00 2001 From: Jason Robbins Date: Thu, 24 Oct 2024 14:39:42 -0700 Subject: [PATCH] Switch localhost development to port 7777. (#4475) * Switch localhost development to port 8888. * Use 7777 instead * Also correct port number in settings.py and goldens --- README.md | 4 ++-- framework/cloud_tasks_helpers.py | 2 +- framework/cloud_tasks_helpers_test.py | 2 +- gen/py/chromestatus_openapi/Dockerfile | 2 +- .../testdata/notifier_test/test_format_email_body__new.html | 4 ++-- .../test_format_email_body__update_no_changes.html | 4 ++-- .../test_format_email_body__update_with_changes.html | 4 ++-- .../notifier_test/test_make_extension_approved_email.html | 4 ++-- .../test_build_email_tasks_escalated_feature_accuracy.html | 4 ++-- .../test_build_email_tasks_feature_accuracy.html | 4 ++-- .../test_build_email_tasks_feature_accuracy_enterprise.html | 4 ++-- .../test_build_email_tasks_prepublication.html | 6 +++--- main.py | 2 +- packages/playwright/docker-compose.yml | 2 +- packages/playwright/playwright.config.cjs | 4 ++-- packages/playwright/wait-for-app.sh | 2 +- scripts/start_server.sh | 2 +- settings.py | 4 ++-- 18 files changed, 30 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 28264c27cdea..704929c5f11d 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ To start the main server and the notifier backend, run: ```bash npm start ``` -Then visit `http://localhost:8080/`. +Then visit `http://localhost:7777/`. To start front end code watching (sass, js lint check, babel, minify files), run @@ -128,7 +128,7 @@ Chromestatus currently gets the list of Blink components from the file `hack_com #### Seed the blink component owners -Visit http://localhost:8080/admin/blink/populate_blink to see the list of Blink component owners. +Visit http://localhost:7777/admin/blink/populate_blink to see the list of Blink component owners. #### Debugging / settings diff --git a/framework/cloud_tasks_helpers.py b/framework/cloud_tasks_helpers.py index c11a471d7b2f..b10b710995b3 100644 --- a/framework/cloud_tasks_helpers.py +++ b/framework/cloud_tasks_helpers.py @@ -52,7 +52,7 @@ def queue_path(self, project, location, queue): def create_task(self, parent=None, task=None, **kwargs): """Immediately hit the target URL.""" uri = task.get('app_engine_http_request').get('relative_uri') - target_url = 'http://localhost:8080' + uri + target_url = 'http://localhost:7777' + uri body = task.get('app_engine_http_request').get('body') logging.info('Making request to %r', target_url) handler_response = requests.request('POST', diff --git a/framework/cloud_tasks_helpers_test.py b/framework/cloud_tasks_helpers_test.py index 89107a1b2712..7a8e0c6cab0f 100644 --- a/framework/cloud_tasks_helpers_test.py +++ b/framework/cloud_tasks_helpers_test.py @@ -47,7 +47,7 @@ def test_create_task(self, mock_fetch): self.assertIsNone(actual) mock_fetch.assert_called_once_with( 'POST', - 'http://localhost:8080/handler', + 'http://localhost:7777/handler', data=b'{"a": 1}', allow_redirects=False, headers={'X-AppEngine-QueueName': 'default'}) diff --git a/gen/py/chromestatus_openapi/Dockerfile b/gen/py/chromestatus_openapi/Dockerfile index be4183f513fd..701529a17ce4 100644 --- a/gen/py/chromestatus_openapi/Dockerfile +++ b/gen/py/chromestatus_openapi/Dockerfile @@ -13,4 +13,4 @@ EXPOSE 8080 ENTRYPOINT ["python3"] -CMD ["-m", "chromestatus_openapi"] \ No newline at end of file +CMD ["-m", "chromestatus_openapi"] diff --git a/internals/testdata/notifier_test/test_format_email_body__new.html b/internals/testdata/notifier_test/test_format_email_body__new.html index 28d545c1b0a0..c3c6fa3c77d1 100644 --- a/internals/testdata/notifier_test/test_format_email_body__new.html +++ b/internals/testdata/notifier_test/test_format_email_body__new.html @@ -16,7 +16,7 @@ feature template @@ -67,7 +67,7 @@
Your next steps:
- View feature details
diff --git a/internals/testdata/notifier_test/test_format_email_body__update_no_changes.html b/internals/testdata/notifier_test/test_format_email_body__update_no_changes.html index cc0f925e15a5..4aa8d8528de3 100644 --- a/internals/testdata/notifier_test/test_format_email_body__update_no_changes.html +++ b/internals/testdata/notifier_test/test_format_email_body__update_no_changes.html @@ -16,7 +16,7 @@ feature template @@ -35,7 +35,7 @@
Your next steps:
- View feature details
diff --git a/internals/testdata/notifier_test/test_format_email_body__update_with_changes.html b/internals/testdata/notifier_test/test_format_email_body__update_with_changes.html index 8cfb33a72659..57a87e17d636 100644 --- a/internals/testdata/notifier_test/test_format_email_body__update_with_changes.html +++ b/internals/testdata/notifier_test/test_format_email_body__update_with_changes.html @@ -16,7 +16,7 @@ feature template @@ -35,7 +35,7 @@
Your next steps:
- View feature details
diff --git a/internals/testdata/notifier_test/test_make_extension_approved_email.html b/internals/testdata/notifier_test/test_make_extension_approved_email.html index 40a5c2c413bf..b59320844dc0 100644 --- a/internals/testdata/notifier_test/test_make_extension_approved_email.html +++ b/internals/testdata/notifier_test/test_make_extension_approved_email.html @@ -16,7 +16,7 @@ A feature @@ -36,7 +36,7 @@
Your next steps:
- Finalize trial extension
diff --git a/internals/testdata/reminders_test/test_build_email_tasks_escalated_feature_accuracy.html b/internals/testdata/reminders_test/test_build_email_tasks_escalated_feature_accuracy.html index 75d4cd3b0d06..6aeefea63128 100644 --- a/internals/testdata/reminders_test/test_build_email_tasks_escalated_feature_accuracy.html +++ b/internals/testdata/reminders_test/test_build_email_tasks_escalated_feature_accuracy.html @@ -16,7 +16,7 @@ feature one @@ -93,7 +93,7 @@
Your next steps:
- Verify feature accuracy
diff --git a/internals/testdata/reminders_test/test_build_email_tasks_feature_accuracy.html b/internals/testdata/reminders_test/test_build_email_tasks_feature_accuracy.html index dd464256ae34..63d5e64e9e98 100644 --- a/internals/testdata/reminders_test/test_build_email_tasks_feature_accuracy.html +++ b/internals/testdata/reminders_test/test_build_email_tasks_feature_accuracy.html @@ -16,7 +16,7 @@ feature one @@ -88,7 +88,7 @@
Your next steps:
- Verify feature accuracy
diff --git a/internals/testdata/reminders_test/test_build_email_tasks_feature_accuracy_enterprise.html b/internals/testdata/reminders_test/test_build_email_tasks_feature_accuracy_enterprise.html index 01d86d296ef1..a6ee5ee07aba 100644 --- a/internals/testdata/reminders_test/test_build_email_tasks_feature_accuracy_enterprise.html +++ b/internals/testdata/reminders_test/test_build_email_tasks_feature_accuracy_enterprise.html @@ -16,7 +16,7 @@ feature one @@ -88,7 +88,7 @@
Your next steps:
- Verify feature accuracy
diff --git a/internals/testdata/reminders_test/test_build_email_tasks_prepublication.html b/internals/testdata/reminders_test/test_build_email_tasks_prepublication.html index d23300903614..554d8d4f2f5d 100644 --- a/internals/testdata/reminders_test/test_build_email_tasks_prepublication.html +++ b/internals/testdata/reminders_test/test_build_email_tasks_prepublication.html @@ -16,7 +16,7 @@ feature one @@ -43,7 +43,7 @@

1. Locate your releases on the roadmap.

Please check where your feature appears on the - roadmap page. + roadmap page. If your feature does not appear, you may need to fill in milestone values or update the feature's implementation status. Be sure that you have gotten all needed approvals.

@@ -70,7 +70,7 @@

feature one

- View feature details

Guidelines for writing the summary:

diff --git a/main.py b/main.py index 0264af53ccc2..07bb6c62d973 100644 --- a/main.py +++ b/main.py @@ -367,4 +367,4 @@ class Route: # This is used when running locally only. When deploying to Google App # Engine, a webserver process such as Gunicorn will serve the app. This # can be configured by adding an `entrypoint` to app.yaml. - app.run(host='127.0.0.1', port=8080) + app.run(host='127.0.0.1', port=7777) diff --git a/packages/playwright/docker-compose.yml b/packages/playwright/docker-compose.yml index b06612d61d57..ba23e9ef9c49 100644 --- a/packages/playwright/docker-compose.yml +++ b/packages/playwright/docker-compose.yml @@ -69,7 +69,7 @@ services: command: bash -c "source cs-env/bin/activate; env && whoami && npm run start-app" network_mode: host healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8080"] + test: ["CMD", "curl", "-f", "http://localhost:7777"] interval: 30s timeout: 10s retries: 10 diff --git a/packages/playwright/playwright.config.cjs b/packages/playwright/playwright.config.cjs index 4436919f7e45..3f8211a9213b 100644 --- a/packages/playwright/playwright.config.cjs +++ b/packages/playwright/playwright.config.cjs @@ -30,7 +30,7 @@ module.exports = defineConfig({ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { /* Base URL to use in actions like `await page.goto('/')`. */ - baseURL: 'http://localhost:8080', + baseURL: 'http://localhost:7777', /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ trace: 'on-first-retry', @@ -98,7 +98,7 @@ module.exports = defineConfig({ /* Run your local dev server before starting the tests */ webServer: { command: 'npm run start', - url: 'http://localhost:8080', + url: 'http://localhost:7777', reuseExistingServer: true, }, }); diff --git a/packages/playwright/wait-for-app.sh b/packages/playwright/wait-for-app.sh index 7813de3af4a9..cc6cb43111a2 100755 --- a/packages/playwright/wait-for-app.sh +++ b/packages/playwright/wait-for-app.sh @@ -1,6 +1,6 @@ #!/bin/bash # echo "waiting for backend to come up" -while [[ "$(curl --connect-timeout 2 -s -o /dev/null -w ''%{http_code}'' http://localhost:8080)" != "200" ]]; do +while [[ "$(curl --connect-timeout 2 -s -o /dev/null -w ''%{http_code}'' http://localhost:7777)" != "200" ]]; do echo .. sleep 10 done diff --git a/scripts/start_server.sh b/scripts/start_server.sh index 798ce6230861..e174d9d50216 100755 --- a/scripts/start_server.sh +++ b/scripts/start_server.sh @@ -11,7 +11,7 @@ export GAE_ENV='localdev' export DATASTORE_EMULATOR_HOST=${DATASTORE_EMULATOR_HOST:-'localhost:15606'} -gunicorn --bind :8080 --workers 4 main:app +gunicorn --bind :7777 --workers 4 main:app # TODO(jrobbins): Consider switching back to dev_appserver when diff --git a/settings.py b/settings.py index 9213d22fde60..57f03e0c3188 100644 --- a/settings.py +++ b/settings.py @@ -95,11 +95,11 @@ def get_flask_template_path() -> str: if UNIT_TEST_MODE: APP_TITLE = 'Local testing' - SITE_URL = 'http://127.0.0.1:8888/' + SITE_URL = 'http://127.0.0.1:7777/' elif DEV_MODE: PROD = False APP_TITLE = 'Chrome Status Dev' - SITE_URL = 'http://127.0.0.1:8888/' + SITE_URL = 'http://127.0.0.1:7777/' elif APP_ID == 'cr-status': PROD = True DEBUG = False