Instead of users having to write this manually, just create it.
Details
- Reviewers
ashoat atul • abosh varun - Group Reviewers
Restricted Owners Package (Owns No Changed Paths) - Commits
- rCOMM618c72de9519: [Nix] Auto-generate url json configuration files
# move old directory test -d keyserver/facts && mv keyserver/facts{,.bak} nix develop # assert files were written cat keyserver/facts/{commapp,landing}_url.json # move old directory back test -d keyserver/facts.bak && rm -r keyserver/facts && mv keyserver/facts{.bak,}
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Very incomplete test plan. You need to test the app thoroughly. Think about how you can test it more and add a whole bunch of things to the test plan
scripts/create_url_facts.sh | ||
---|---|---|
11 ↗ | (On Diff #17256) | Use [[ and ]] instead of [ and ] has been discussed to death... please use [[, unless you have a good reason (which you should call out... you're going to get this feedback every time) |
scripts/templates/commapp_url.json | ||
4 ↗ | (On Diff #17256) | I don't think this is right. Can you update your test plan to include registering / logging in / playing around with / refreshing the app? (Also the landing page) |
6 ↗ | (On Diff #17256) | You're missing a proxy config. I have no idea how you got this to work. Worries me that your test plan was incomplete |
I don't think this is right. Can you update your test plan to include registering / logging in / playing around with / refreshing the app? (Also the landing page)
I would probably need to pair with someone to see that all of these workflows are satisfied. I'm being pulled in a lot of different directions, and don't really have context on "what you should be able to do". The current dev docs lack any type of user workflows.
scripts/templates/commapp_url.json | ||
---|---|---|
6 ↗ | (On Diff #17256) | I don't understand. If you're referring to apache proxying, that should only be needed if we need to forward traffic from port 80. If the port is specified, then proxying shouldn't be needed. Unless I'm missing something |
@atul and I paired, and from a cleaned repository (e.g. git clean -xfd && rm -rf ~/.local/share/MariaDB), we were able to post a message after creating a user.
scripts/create_url_facts.sh | ||
---|---|---|
11 ↗ | (On Diff #17256) | Feedback has not been addressed... |
Apply whitespace feedback
scripts/create_url_facts.sh | ||
---|---|---|
11 ↗ | (On Diff #17256) | just used test to avoid [ vs [[ issue. |
scripts/templates/commapp_url.json | ||
4 ↗ | (On Diff #17256) | I was able login, create a thread, navigate to the calendar, refresh the page fine. I can update the test plan with the end-to-end workflow |
scripts/templates/landing_url.json | ||
5 ↗ | (On Diff #17550) | if the basePath is the same as the baseRoutePath, then you don't need the proxy pass for different routes. The configuration from the docs aren't needed if these routes are the same |
just used test to avoid [ vs [[ issue.
Is test basically just a third variety here? Can we update our code to only use one variety of shell-scripting test? The goal of insisting on [[ instead of [ is consistency across the codebase... seems like we're getting even further away from that by introducing a third category of condition to sneakily avoid the feedback about [[ vs. [. Let me know if I'm misinterpreting here!
scripts/templates/landing_url.json | ||
---|---|---|
5 ↗ | (On Diff #17550) |
I don't follow what you're talking about here. It seems to reflect a misunderstanding about what proxy does. I think what happened is that you found proxy was not necessary during testing, and then you went ahead and made some assumptions about what it does instead of diving deeper to understand what's going on. I usually don't have time to do a deep-dive in the code to clarify misconceptions, but in this case I wrote the code and I can take a second to help you out. In the future, it's my expectation that you'll be able to do this sort of "deep-dive" on your own. Let's start by answering the question, "What does "proxy": "none": do?" You seem to have the perception that it decides whether to set up a "proxy pass", but that's not quite accurate. A good way to understand what something does it git grep. Here's what I see when I run git grep in keyserver: ashoat@ashoatmbp2021 [~/src/comm/keyserver]$ git grep proxy src/session/cookies.js: const { proxy } = getAppURLFactsFromRequestURL(req.originalUrl); src/session/cookies.js: if (proxy === 'none') { src/session/cookies.js: } else if (proxy === 'apache') { src/utils/security-utils.js: const { https, proxy } = getAppURLFactsFromRequestURL(req.originalUrl); src/utils/security-utils.js: (proxy === 'none' && req.protocol !== 'https') || src/utils/security-utils.js: (proxy === 'apache' && req.get('X-Forwarded-SSL') !== 'on') src/utils/urls.js: +proxy?: 'apache' | 'none', // defaults to apache src/utils/urls.js: const { proxy } = urlFacts; src/utils/urls.js: proxy: validProxies.has(proxy) ? proxy : 'apache', Let's look three all three of these files:
Now that we've looked at the code, we can start to understand more about proxy and why it matters. Now we have two questions to answer:
For the first question, we can see clearly in the second file that https: false means that code doesn't even look at proxy. As for the first file, the getRequestIPAddress function is called from three places: fetchViewerForSocket, fetchViewerForJSONRequest, and fetchViewerForHomeRequest. None of these three callsites are accessed by the landing code in keyserver, so that explains the behavior you saw. Next, let's ask "what should landing_url.json contain?" We can answer this by considering what proxy is meant to do.
With this we can confidently conclude that you need to make a change here. |
scripts/templates/landing_url.json | ||
---|---|---|
5 ↗ | (On Diff #17550) | This would have been a lot easier if the non-apache workflow was already documented. I don't have the context as to how apache + keyserver + commapp + landing should interact. Part of the reason why I really wanted to pair with someone was to have this context while iterating on the "desired solution". We just found a working solution which fit the original intent of "generate something which can be used for development". Having a lot of the tickets be, "you need to become intimately familiar with every use case for every workflow" is just setting me up for failure and despair. |
scripts/templates/landing_url.json | ||
---|---|---|
6 ↗ | (On Diff #17847) | Yea, sorry was still waking up |