Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(helm/coder): make HTTPS redirect status code configurable - #27360

Merged
nickvigilante merged 1 commit into
coder:mainfrom
02strich:main
Aug 3, 2026
Merged

feat(helm/coder): make HTTPS redirect status code configurable#27360
nickvigilante merged 1 commit into
coder:mainfrom
02strich:main

Conversation

@02strich

Copy link
Copy Markdown
Contributor

Add coder.httproute.httpsRedirect.statusCode to configure the HTTPRoute redirect response code, defaulting to 308. Validate that the value is one of 301, 302, 303, 307, or 308.

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@github-actions github-actions Bot added the community Pull Requests and issues created by the community. label Jul 21, 2026

@nickvigilante nickvigilante 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.

301 and 308 have differences in functionality, where 308 does not permit downgrades from POST to GET. Is this intentional?

@02strich

Copy link
Copy Markdown
Contributor Author

@nickvigilante intentional yes, avoidable no: 308 is not supported by ALB which means the implementation of the gateway objects fails. I fully agree with the default of 308 but for the people who can't use it, this aims to add an option to make a trade-off

@nickvigilante

Copy link
Copy Markdown
Contributor

@02strich Thanks for the quick response! I'm going to defer the review to one of our engineers on this one, so stay tuned.

@rowansmithau
rowansmithau self-requested a review July 22, 2026 02:47
@rowansmithau

Copy link
Copy Markdown
Member

thanks for the PR @02strich - I added a review item for one section. If you can add that and sign the CLA as next steps please.

@02strich

Copy link
Copy Markdown
Contributor Author

thanks @rowansmithau I'll look into the CLA tomorrow, but I am not seeing the review item - where can i find that?

Comment thread helm/coder/templates/httproute.yaml Outdated
@rowansmithau

Copy link
Copy Markdown
Member

thanks @rowansmithau I'll look into the CLA tomorrow, but I am not seeing the review item - where can i find that?

apologies, forgot to hit submit on the in progress review!

@02strich

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

cdrci2 added a commit to coder/cla that referenced this pull request Jul 23, 2026
@02strich

Copy link
Copy Markdown
Contributor Author

@rowansmithau I think all done! Thank you for the quick feedback

@rowansmithau

Copy link
Copy Markdown
Member

LGTM, approved

@02strich

Copy link
Copy Markdown
Contributor Author

@rowansmithau I am sorry to bother, but seems like the windows unit tests are broken with something unrelated to this change - any ideas?

@nickvigilante

Copy link
Copy Markdown
Contributor

@02strich I did some research myself on this, and the CI failures are unrelated to your work in this PR. It seems to be a flake installing a specific Go tool (mtimehash) on the Windows runner for that test. The Storybook error is also unrelated but won't block merge. Sorry for the extra hurdles!

nickvigilante added a commit that referenced this pull request Aug 3, 2026
## What

Add `shell: bash` to the `Install Go mise tools` step in the
`test-go-pg` job so it runs under Git bash on the `windows-2022` matrix
leg.

## Why

`test-go-pg (windows-2022)` has been failing in the **Normalize File and
Directory Timestamps** step with:

```
mtimehash: command not found
##[error]Process completed with exit code 127.
```

before any tests run, which trips the aggregate `required` gate.

Root cause: the `Install Go mise tools` step had no `shell:`, so on
Windows it ran under **PowerShell**, while `./.github/scripts/retry.sh`
is a bash script (`#!/usr/bin/env bash`). The step silently no-oped on
Windows (zero output), so `mtimehash` was only present when the mise
tool cache was warm. On a cache miss it was never installed, and the
normalize step failed with exit 127. `main` stays green only because the
cache is usually warm — both green and failing runs use the same
`depot-windows-2022-16` runner, so this is **not** a fork/runner-routing
issue.

Pre-existing CI-tooling issue, unrelated to the change that surfaced it
(a Helm-only community PR, #27360).

## Fix

One line: pin the step to `shell: bash` so the install actually runs on
Windows and repairs a cache miss instead of being silently skipped.

## Verification

<details>
<summary>Local proof that the step's install target builds and
<code>mtimehash</code> runs under bash</summary>

```
$ bash ./.github/scripts/retry.sh --max-attempts 1 -- echo "retry.sh OK under bash"
retry.sh OK under bash

$ GOBIN=/tmp/demobin go install github.com/slsyy/mtimehash/cmd/[email protected]
$ ls -l /tmp/demobin/mtimehash
-rwxr-xr-x 1 coder coder 6692858 /tmp/demobin/mtimehash

# the tool that was "command not found" now runs and rewrites the mtime:
$ printf 'hello' > /tmp/mt.txt                 # mtime 2026-07-24 15:32
$ find /tmp/mt.txt | /tmp/demobin/mtimehash    # exit 0
$ # mtime now 1997-11-30 (content-hash derived)
```
</details>

Final confirmation is this PR's own `test-go-pg (windows-2022)` run.
Note: if the mise cache is warm on this run the job passes regardless;
the fix specifically hardens the cache-miss path this step exercises on
Windows.

## Follow-up (not in this PR)

- Make the normalize step resilient (skip when `mtimehash` is absent /
invoke via `mise exec`) so a missing cache optimizer can't hard-fail the
job.
- Audit other Windows `run:` steps that invoke `retry.sh`/bash scripts
without `shell: bash`.

Linear: DOCS-605

> This PR was created with AI assistance (Coder Agents).
Add coder.httproute.httpsRedirect.statusCode to configure the HTTPRoute redirect response code, defaulting to 308. Validate that the value is one of 301, 302, 303, 307, or 308.
@nickvigilante
nickvigilante enabled auto-merge (squash) August 3, 2026 16:57
@nickvigilante
nickvigilante merged commit 24ff135 into coder:main Aug 3, 2026
27 of 28 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

community Pull Requests and issues created by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants