Commit Graph

8 Commits

Author SHA1 Message Date
Paul Melnikow
84db9e6fe3 Remove IP filtering code for prometheus metrics (#3059)
Closes #2657
2019-02-20 18:38:16 +00:00
Paul Melnikow
d8ce045ead Adopt Gatsby (#2906)
While Next.js can handle static sites, we've had a few issues with it, notably a performance hit at runtime and some bugginess around routing and SSR. Gatsby being fully intended for high-performance static sites makes it a great technical fit for the Shields frontend. The `createPages()` API should be a really nice way to add a page for each service family, for example.

This migrates the frontend from Next.js to Gatsby. Gatsby is a powerful tool, which has a bit of downside as there's a lot to dig through. Overall I found configuration easier than Next.js. There are a lot of plugins and for the most part they worked out of the box. The documentation is good.

Links are cleaner now: there is no #. This will break old links though perhaps we could add some redirection to help with that. The only one I’m really concerned about `/#/endpoint`. I’m not sure if folks are deep-linking to the category pages.

There are a lot of enhancements we could add, in order to speed up the site even more. In particular we could think about inlining the SVGs rather than making separate requests for each one.

While Gatsby recommends GraphQL, it's not required. To keep things simple and reduce the learning curve, I did not use it here.

Close #1943 
Fix #2837 Fix #2616
2019-02-06 16:37:55 -05:00
Paul Melnikow
7955f460f3 Move suggest code and rewrite tests (#2886)
The suggest code was an exception to our usual organization pattern. There was a service test, but it's not a service. The code would sometimes regress because it wasn't being tested all the time.

This makes them no longer run as service tests, which is good because they run as part of every build. Some of them are smaller-bracket tests which is good too, because it will make them easier to test, especially as this code grows.

I'd have liked to keep using frisby for the ones that make requests to the server, though I ran into some issues with sequencing of setup that I think will require upstream changes.
2019-01-30 17:48:54 -06:00
Paul Melnikow
be7cb93773 Refactor service loader (#2861)
This moves the loader code into `core/base-service`, leaving behind in `services/index.js` only the convenience imports.

Ref #2832
2019-01-24 22:55:10 -05:00
Paul Melnikow
aac2a4d5ad Move legacy request helpers (#2829)
In #2698 we decided to put legacy helper functions in `core/legacy`. I think that’s a fine idea, though if we’re going to have a bunch of badge helper functions in there, it seems like it is probably better to keep these two important but esoteric helper functions with the core code to which they are most coupled. So I added `legacy-` to the name, and put them in `core/base-service`.
2019-01-21 22:14:22 -05:00
Paul Melnikow
94acb92258 Rewrite test of analytics endpoint (#2810)
This test is being weirdly flaky in #2809. The problem seems to be in the test helper code, so I rewrote this using Joi.

I imagine the change has to do with a change to the test ordering. It's a bit puzzling.

However, the new test seems fine (and the endpoint is rarely used; not critical to begin with).
2019-01-18 23:51:07 -05:00
Paul Melnikow
4415a3e94e Reorganize badge URL helper functions (#2790)
Ref #2698
2019-01-17 13:44:46 -05:00
Paul Melnikow
18b98a30e3 Reorganize server and service test runner (#2781)
Ref #2698
2019-01-16 16:30:18 -05:00