-
Notifications
You must be signed in to change notification settings - Fork 5
feat(web): initial work to setup root handler in the web component #2192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ec30def
to
50ef28e
Compare
d0e9711
to
8ec8727
Compare
8ec8727
to
d905503
Compare
@@ -124,7 +124,6 @@ func (a *API) RegisterRoutes(router *mux.Router) { | |||
router.PathPrefix("/swagger/").Handler(httpSwagger.WrapHandler) | |||
|
|||
router.HandleFunc("/auth/login", a.postAuthLogin).Methods("POST") | |||
router.HandleFunc("/branding", a.getBranding).Methods("GET") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We no longer need the branding routes.
#2201 should address the CI failures. It's probably better than creating a placeholder index.html file in the |
e931fe4
to
bd6de36
Compare
This PR has been released (on staging) and is available for download with a embedded-cluster-smoke-test-staging-app license ID. Online Installer:
Airgap Installer (may take a few minutes before the airgap bundle is built):
Happy debugging! |
@@ -581,7 +581,7 @@ func Test_runInstallAPI(t *testing.T) { | |||
}, | |||
} | |||
resp, err := httpClient.Get(url) | |||
assert.NoError(t, err) | |||
require.NoError(t, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Later it would panic leading to a red herring because there's no resp
.
@@ -224,94 +223,3 @@ func TestAPIError_ErrorOrNil(t *testing.T) { | |||
}) | |||
} | |||
} | |||
|
|||
func TestAPIError_JSON(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some mismatch between PRs that have been merged, this fixes some go vet issues:
go test -tags $(GO_BUILD_TAGS) -v ./pkg/... ./cmd/... | ||
go test -tags $(GO_BUILD_TAGS) -v ./pkg/... ./cmd/... ./api/... ./web/... ./pkg-new/... | ||
$(MAKE) -C operator test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We haven't been running the full unit test suite in CI.
// webAssetsFS is the filesystem to be used by the web component. Defaults to nil allowing the web server to use the default assets embedded in the binary. Useful for testing. | ||
var webAssetsFS fs.FS = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not particularly happy about this, unsure if we should keep this somewhere else, open to ideas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than that README.md hack could you have a stub index.html?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main issue with that is when building the web assets, index.html
will change and it's not gitignored so you'll end up with changes that shouldn't be staged for commit.
// webAssetsFS is the filesystem to be used by the web component. Defaults to nil allowing the web server to use the default assets embedded in the binary. Useful for testing. | ||
var webAssetsFS fs.FS = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than that README.md hack could you have a stub index.html?
@@ -560,6 +561,29 @@ func Test_runInstallAPI(t *testing.T) { | |||
certPool := x509.NewCertPool() | |||
certPool.AddCert(cert.Leaf) | |||
|
|||
// We need a release object to pass over to the Web component. | |||
dataMap := map[string][]byte{ | |||
"kots-app.yaml": []byte(` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably include an icon and a title
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can, albeit it's not really being used right now. Unless we also want to run some requests within this test against the web components?
Merging as the changes aren't related to the flaky e2e tests. |
What this PR does / why we need it:
Story: https://app.shortcut.com/replicated/story/124147/setup-template-enabled-web-handlers
The idea is to setup a root handler that we can template our initial HTML we serve with any needed state we need before rendering the app.
We should follow up with a way we can redirect requests to the vite dev server when running local dev for faster dev feedback loop.
Which issue(s) this PR fixes:
Does this PR require a test?
Does this PR require a release note?
Does this PR require documentation?