Commit Graph

33 Commits

Author SHA1 Message Date
Pierre-Yves Bigourdan
1e4c8f54d7 Sunsetting Shields custom logos (#10347)
* Sunsetting Shields custom logos

* Reinstate info to contribute to SimpleIcons

* Mention that no changes are required
2024-07-13 19:14:54 +00:00
dependabot[bot]
b9d96755ec chore(deps-dev): bump prettier from 2.8.8 to 3.0.0 (#9357)
* chore(deps-dev): bump prettier from 2.8.8 to 3.0.0

Bumps [prettier](https://github.com/prettier/prettier) from 2.8.8 to 3.0.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.8...3.0.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* reformat all the things (prettier 3)

* update tests to await calls to prettier.format()

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: chris48s <git@chris-shaw.dev>
2023-07-10 09:27:51 +00:00
chris48s
50ea7068a8 migrate frontend to docusaurus (#9014)
* delete loads of really important stuff that we definitely need

* v basic MVP smoosh docusaurus PoC into repo

* TODO

* delete more really important stuff

* TODO

* tidyup: use run-s

* don't redirect images used in frontend to raster proxy

* fix routing

* preserve the /endpoint link

* delete the blog (for now)

I would quite like to re-add this at some point
but its not really the top priority thing right now

* content edits

* appease the lint gods

* update danger rules

* remove placeholder

* cypress tests

* dockerhub --> ghcr

* Revert "dockerhub --> ghcr"

This reverts commit ef74cbb26b.

* downgrade lockfile format

* implement defs/BASE_URL

* fix e2e build

* actually fix cypress tests

* always run cypress tests on build

* this never worked

* add command for docusaurus:clear

* delete more code we don't need any more

* update ESLint/prettier config

* delete unsused exports

* documentation updates

* delete a fairly large chunk of our dependency tree

* allow base_url as build arg to Dockerfile

* fixup dockerfile

* work out base url at runtime if not set

doing this at image build time is not the right approach

* remove gatsby monorepo from closebot

* rename HomepageFeatures to homepage-features
2023-06-17 10:59:07 +01:00
chris48s
27a2deb7d2 remove danger-plugin-no-test-shortcuts (#8815)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-01-16 23:20:53 +00:00
chris48s
ae018cdddc conform to standard js quote rules (#8395)
* restore standardjs quote behaviour

* conform to standard js quote rules
2022-09-12 17:22:12 +01:00
Pierre-Yves B
23c0406bed Migrate from CommonJS to ESM (#6651) 2021-07-09 12:53:55 +01:00
Paul Melnikow
3a23695f89 Update Danger rule for joi (#5667)
Follow-on to #5624
2020-10-06 20:48:03 -04:00
Paul Melnikow
39756bde78 Clean up Danger rule for serverSecrets (#5627)
"serverSecrets" is no longer used to access auth in services, so it no longer makes sense to include it in this rule.

Ref #3393
2020-09-29 20:44:28 -04:00
chris48s
9ab4596654 fix docs paths in dangerfile (#5136) 2020-05-28 20:56:33 +01:00
Paul Melnikow
ce0ddf93fc Inject secrets into the services (#3652)
This is a reworking of #3410 based on some feedback @calebcartwright left on that PR.

The goals of injecting the secrets are threefold:

1. Simplify testing
2. Be consistent with all of the other config (which is injected)
3. Encapsulate the sensitive auth-related code in one place so it can be studied and tested thoroughly

- Rather than add more code to BaseService to handle authorization logic, it delegates that to an AuthHelper class.
- When the server starts, it fetches the credentials from `config` and injects them into `BaseService.register()` which passes them to `invoke()`.
- In `invoke()` the service's auth configuration is checked (`static get auth()`, much like `static get route()`).
- If the auth config is present, an AuthHelper instance is created and attached to the new instance.
- Then within the service, the password, basic auth config, or bearer authentication can be accessed via e.g. `this.authHelper.basicAuth` and passed to `this._requestJson()` and friends.
- Everything is being done very explicitly, so it should be very clear where and how the configured secrets are being used.
- Testing different configurations of services can now be done by injecting the config into `invoke()` in `.spec` files instead of mocking global state in the service tests as was done before. See the new Jira spec files for a good example of this.

Ref #3393
2019-07-09 23:14:36 -04:00
Paul Melnikow
738d4c78bc Ensure Joi is imported as @hapi/joi [cirrus] (#3681)
* Ensure Joi is imported as @hapi/joi [cirrus]

I noticed this import failed in #3675. Maybe we've finally dropped the last copy of the old joi?

* Ignore dangerfile
2019-07-08 13:09:31 -04:00
Paul Melnikow
991d4a1cad Bump Danger (which now ships with Chainsmoker!) and some housekeeping (#3276)
See https://github.com/danger/danger-js/issues/431#issuecomment-480269809 and danger/danger-js#850
2019-04-07 14:06:22 -05: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
chris48s
a47fb2895d update logo guidance (#2888)
Ref #2510
2019-01-29 15:29:51 -06:00
Paul Melnikow
31f0b8e6d8 Optimize diffing in Danger (#2827) 2019-01-21 20:16:50 +00:00
Paul Melnikow
84a6d28250 Add instructions for testing Danger locally (#2691) 2019-01-08 00:16:05 -05:00
chris48s
d96d8ae193 Document private/secret.json; affects [bower jira] (#2599)
* don't use a libraries.io token for bower integration

The libraries.io docs claim you need to be authenticated
to make any API request: https://libraries.io/api#authentication

In practice we can call https://libraries.io/api/bower/jquery
just fine with no token and based on chucking a load of
requests at it and examining the `x-ratelimit-remaining`
headers you actually seem to get a better limit with no
authentication.

All of our libraries.io badges in `services/librariesio`
seem to have been running fine with no token for some time.


* change jira auth settings to jira_user, jira_pass

All the other services use servicename_user, servicename_pass

This switches JIRA to use that convention by preference
but supports _username and _password for legacy users.


* add docs for server secrets


* add danger rule for server-secrets.md

this rule prompts users to update server-secrets.md
if 'serverSecrets' is in the diff
2019-01-02 20:49:42 +00:00
Paul Melnikow
5c7d07f5be Rework styling using styled-components (#2517)
The CSS in the project is relatively difficult to change. While it is very DRY, it relies heavily on inheritance. It's difficult to make changes in the markup modal without it also affecting styles elsewhere.
 
[styled-components](https://www.styled-components.com/) is one of the leading CSS-in-JS libraries. By reducing dependency on global state and CSS inheritance, styles become explicit and are easier to inspect and change. It's also convenient that styles can be embedded with the components they modify.

At runtime, the library creates CSS classes, so it's pretty efficient.

We were using a little bit of [styled-jsx](https://github.com/zeit/styled-jsx) before, which ships with Next.js, though styled-components is more widely used and I've had good experiences with it all around.

In a few cases I've duplicated styles where it feels more natural to do that: for example, `text-align: center` is duplicated in `Main` and `MarkupModal`.

Much of this is a refactor, though there are a few visual changes, particularly in the markup modal and the style examples.
2018-12-18 16:44:47 -05:00
Pierre-Yves B
e9b19416e2 Updated Danger server guideline (#2467) 2018-12-06 22:04:15 +00:00
Paul Melnikow
d55e1c15a6 Enforce using async-await [f-droid] (#2241)
Close #2028
2018-11-04 00:33:47 -04:00
Paul Melnikow
1b307864b4 Prettify the files in the project root (#2041)
Follow on to #2009
2018-09-02 12:10:23 -07:00
Paul Melnikow
102141123b Unify lint rules and clean lint (#2009)
Now that server.js is emptied out, it makes sense to eliminate the differences between the top-level .js files and everything else.
2018-09-01 11:08:17 -07:00
tooomm
e37c0b650d tidy danger bot messages (#2013) 2018-08-31 09:51:30 +12:00
tooomm
78bb890b52 danger: highlight service in msg (#1928) 2018-08-26 16:16:21 -04:00
Nicco Kunzmann
9428c20418 danger: help users to write server tests (#1970)
* danger: help users to write server tests

- fixes https://github.com/badges/shields/issues/1968
- adds the desired notice

* add trailing comma

https://circleci.com/gh/badges/shields/11866?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link
2018-08-25 17:55:02 +02:00
Paul Melnikow
9119c235a9 Prevent merging exclusive service tests (#1926)
* Remove an .only() left behind previously
2018-08-16 11:06:08 -07:00
Paul Melnikow
7e04f25fc5 Tweak layout of services to conveniently handle large service families 2018-08-01 16:49:07 -04:00
Danial
3a54b5dc84 eslint enable comma-dangle always-multiline (#1818)
https://eslint.org/docs/rules/comma-dangle
2018-08-01 08:38:04 +12:00
chris48s
57a1bf2f08 add more rules to dangerfile (#1703)
* upgrade danger.js to latest version

* If PR contains tests using assert, suggest expect syntax

* if PR touches service, check service tester also touched
2018-05-30 18:39:27 +01:00
Paul Melnikow
ea4b758612 Move service tests alongside code (#1563)
Per discussion in #1543
2018-03-20 18:32:48 -07:00
chris48s
f8d511fae2 Add some more rules to dangerfile (#1560)
* warn if the target branch is not master
* link to the logo guidance if PR modifies a SVG file in /logo/
2018-03-11 20:05:49 +00:00
Paul Melnikow
78bb20dc6a Danger: badge examples are not lib/ + wordsmith (#1381) 2017-12-20 21:11:59 -05:00
Paul Melnikow
d97f07c263 Install Danger (#1352)
… so we can stop saying "you forgot to…" in code review. 😀

This idea has come up a number of times. If we can write code to detect a contributor guideline, this tool will message the contributor automatically in a pull request. This lets people fix their own problems, relieves maintainers and reviewers from nagging, and keeps anyone from having to constantly ask for more tests.

For futher reading:

- [How to use Danger well](http://danger.systems/js/usage/culture.html)
- [Examples of the kind of thing it can do](http://danger.systems/js/)
- [Dangerfile reference](http://danger.systems/js/reference.html)
2017-12-08 10:38:41 -05:00