46 Commits

Author SHA1 Message Date
Danyal Aytekin
e76dccef77 Fix tests, test more, support Node 16-20 (#318)
* Add `.nvmrc` → 14

* Fix package.json's URLs

* Update to Pa11y CI's version (`https` etc)

* Add Node 16 to matrix, and make linter run each time

* Standardise `.editorconfig`

* Upgrade to `actions/checkout@4` and `actions/setup-node@3`

* Replace `npm install` with `npm ci`

* Replace `wait-action` with `sleep 10s`

* Rewrite to detach config, use promises, and replace `request` with `fetch` (adding `node-fetch` until Node 18)

* Delete small single-use helper

* Bump to `pa11y-webservice@4.1` and use caret from here (we control the dep)

* Return to `this.last`, fix syntax errors

* Update copyright to 2023 and remove unused ref

* Fix troubleshooting link

* Remove symbols, since they could become outdated

* Remove missing link

* Replace emoji note with GitHub Markdown note

* Fix setup link

* Replace br with double space

* Replace `sh` with `console` for terminal output

* Rename Mongo DB used in integration tests to avoid clash locally

* Remove JSCS and references to other unused tools

* Remove tooling tasks update

* Compress definitions and layout where it makes sense or brings clarity

* Rename db used in tests to `pa11y-dashboard-integration-test`, to avoid clash with `pa11y-webservice`'s own test DB

* Use briefer syntax

* Fix integration test setup & config

* Reverse function order to return early

* Update to `pa11y-lint-config@3`, update `ecmaVersion` to 2020, remove some rule overrides

* Fix linting errors, remove cruft

* Move linting and broken integration test command into npm scripts (it remains broken)

* Revert `node-fetch` to `^2.7.0` (can't do ESM right now)

* Upgrade to `pa11y-webservice@^4.2` from `^4.1`

* Upgrade to `mocha@^9.2` from `^8.4` (can't do `10` yet because it drops Node 12)

* Use backticks for property names

* Fix anchor link for 'installing MongoDB'

* Reorganise test workflow and add Node `18` and `20` to test matrix

* Fix `lockfile-version` to `2`

* Apply support policy

* Replace Travis badge with one for Actions

* Define some more links, separate code blocks

* Reflect greater confidence in support for recent versions of MongoDB

* Test against MongoDB versions 3-7

* Remove Make tasks `all`, `ci`, `clean`, `install`, `node_modules`, `lint`

* Fix integration test command in workflow

* Restore shallow Mocha command for now

* Move linting into own step `lint` to avoid duplicated warnings

* Give the `test` workflow a better name now that it uses a bigger matrix

* Drop back to ES2019 from ES2020 for Node 12, remove use of `?.`

* Reduce `--slow` to `4000`

* Remove a `describe.only` 👀

* Fix broken test for add new item → standard

* Rename availability check function

* Fix task count check when testing task creation

* Return fully to the original `new` logic

* Use `127.0.0.1` consistently to fix (possible) IPV6 issue

* Fix Cheerio call in failing test

* Add MongoDB 2, and tweak other final versions

* Lower case and shorten test name, to sit well alongside lint job

* Replace `underscore(.groupBy)` with `lodash/groupby`

* Capitalise Puppeteer

* Say we test against MongoDB 2 as well

* Document two replacements of Make with npm scripts

* Revise requirements, permitting Node 16+ and describing Ubuntu issue

* Support Node 16, 18, 20

* Install `lodash.keys` and fix Lodash mistakes

* Fix rebase autoresolution error affecting `index.js` 👀

* This is Pa11y Dashboard not Webservice

* Fix MongoDB link

* Remove unused link def for Puppeteer

* Shush markdown linter

* Actually use `pa11y-webservice@4.3`

* Improve support table

* Don't `fail-fast`

* Remove dependency `underscore`

* Fix dashboard's port definition for integration test

* Set `NODE_ENV=test` for integration tests

* Use `mocha@10`

* Extend the sleep to rule out the service not starting in time

* Wait on port `4000` instead of sleeping

* Fix `wait-on-action` to `v1.1.0`

* Fix includes of `lodash.groupby` and `lodash.keys`

* Label the port waiting action

* Fix to `pa11y-webservice@4.2.0` until dep issue resolved

* Set waiter action to start after 1s, time out after 30s, and log

* Upgrade to `pa11y-webservice@^4.3.1` from `~4.2.0`

* Remove comment about recent versions of MongoDB, since we test with them now
2024-03-13 05:48:58 +00:00
Sangita Mane
8145069fe9 Improve the console messaging on starting the app to avoid confusion. (#292)
* Improve the console messaging on starting the app to avoid confusion.

* Revise logging to present intended URI alongside actual

---------

Co-authored-by: Danyal Aytekin <danyal@alienpaper.com>
2023-11-15 09:26:25 +00:00
Jose Bolos
9dbee59746 Add request logging using morgan
This commit adds request logging to the app using morgan.

Every request will now be logged not one but twice: one when the request is received, and a second time when the response is sent.

The response logging also prints out the time elapsed in processing the request, which will be useful to debug performance issues (calls to the dashboard home are currently taking 4 - 15s on a populated database).

The new code uses a tiny middleware that uses nanoid to generate a random request id that can be used to match requests in the logs.

This logging will help us determine which requests are successful, which requests are slow, and establish what requests may have contributed to causing an application crash, making future debugging easier.
2022-03-08 11:19:15 +01:00
Jose Bolos
321d7bb6ba Split initApp in different functions
This makes the function easier to understand and fixes eslint complaints
about the function having too many statements.
2022-03-07 15:55:34 +01:00
Jose Bolos
b7d45c0913 Reorder the routes to avoid MongoDB ObjectID error
When trying to add a new URL, the Node.js MongoDB driver complains with the following error:
```
ObjectID generation failed. Argument passed in must be a single String of 12 bytes or a string of 24 hex characters
```

This is because the `/new` url gets captured by the `/:id` route defined in `/route/task/index.js`. It's another instance of #244 that I missed when fixing it.
2021-04-09 11:30:35 +02:00
Jose Bolos
7c77467dcf Fix incorrect values being passed to ObjectID (#244)
Due to the routes being defined in the wrong order, certain urls (e.g. `/tasks/:taskid:/edit`) are being captured by the results route instead (e.g. `/tasks/:taskid:/:resultid:`). This is causing the wrong method to being called with parts of the path like `edit`, `run`, etc. being passed as an argument to ObjectID(). As these are not valid MongoDB IDs, the method displays instead an error message:

> Argument passed in must be a single String of 12 bytes or a string of 24 hex characters

Also change the path to the favicon image to be not relative, as this is causing a `favicon.png` string to be sent as an argument to ObjectID() when visiting certain pages due to the previous issue.
2019-09-20 14:57:15 +01:00
Elena Musatova
66d97769a0 Updated results page (#196)
* Update gitignore

* Update makefile. Add hbs helper

* Collect all selectors for errors/warnings/notices

* Add list of techniques that help to solve problems

* Remove task-stats block from sidebar

* Remove script from Makefile

* Update tooltips. Map standards and techniques

* Update layout for new components: new tabs, errors panels, lists of selectors, tooltips and popovers

* Update styles for new layout and components

* Graph buttons and popovers styles

* Reformat less code

* Include popover. Update IE styles

* Problem details. Context popovers

* Update graph buttons. Add sorting by number of errors

* Update graph buttons params

* Fix tooltip names

* Swap details and ignore link-buttons

* Set ignore link colors
2017-10-31 16:10:24 +00:00
Rowan Manning
b24076abf1 Tooling update (#184)
* Use a common Makefile/build process

* Use ESLint with the pa11y lint config
2017-03-21 13:41:46 +00:00
Rowan Manning
e431fefbd8 Use the ES6 linting rules from the website (#138) 2016-07-22 14:34:10 +01:00
Rowan Manning
b1ae55c802 Rename all the repos and uppercase Pa11y 2016-06-01 20:57:09 +01:00
Rowan Manning
ae6208d87e Support Node.js 0.10–6 (#132)
* Update dependencies

* Switch from jsdom to cheerio

* Update the supported Node.js versions

* Recompile the client-side CSS and JS
2016-05-26 15:33:58 +01:00
Rowan Manning
ea48d6a6fd Fix JSCS errors 2016-04-25 21:26:59 +01:00
Rowan Manning
90328cfa39 Fix JSHint errors 2016-04-25 21:17:03 +01:00
Rowan Manning
a79a5a2fe6 Merge branch 'filter-urls' of github.com:nature/pa11y-dashboard into develop 2014-03-04 14:14:49 +00:00
Rowan Manning
c04396e80e Merge branch 'gpl-preamble' of github.com:nature/pa11y-dashboard into develop 2014-02-10 14:56:06 +00:00
Jude Robinson
7b10f2de91 adding the gpl preamble 2014-02-10 14:08:38 +00:00
Rowan Manning
d8cb1b6c71 Write the JavaScript for URL filtering 2014-01-14 11:40:23 +00:00
Rowan Manning
02e22eb094 Add "unigore" buttons to ignored rules 2014-01-13 09:59:13 +00:00
Rowan Manning
ccc7ddfc18 Write the back-end for rule ignoring 2014-01-13 09:58:35 +00:00
perryharlock
74dd5b18c9 Add route and view for edit page 2013-11-27 11:13:19 +00:00
Rowan Manning
8f636173a0 Allow the webservice to run automatically 2013-11-21 09:12:54 +00:00
Rowan Manning
7a1160b257 Add the ability to have a site-wide message 2013-11-15 16:28:37 +00:00
Rowan Manning
98bd9ed208 Add a readonly mode for demo/public-facing sites 2013-11-15 16:19:12 +00:00
Rowan Manning
55d44685e9 Disable search engine indexing by default 2013-11-15 15:58:49 +00:00
Rowan Manning
597b0746ec Add WCAG 2.0 link to the footer 2013-11-11 10:37:58 +00:00
Rowan Manning
0b993b4c99 Fix expires error, update to be a week 2013-11-05 12:03:14 +00:00
Rowan Manning
98d948fd52 Compress static files 2013-11-05 11:58:57 +00:00
Rowan Manning
4f46621aaf Compile LESS files with grunt 2013-11-05 11:23:19 +00:00
Rowan Manning
84d36d383b Give pages unique H1s 2013-10-03 14:50:02 +01:00
Rowan Manning
c2ed1beb0e Add the ability to run tasks ad-hoc 2013-10-03 14:18:31 +01:00
perryharlock
8fc041ff3e Issue 44 - Added more info to the footer 2013-10-03 13:52:37 +01:00
Rowan Manning
3104cbfdf9 Autocompile LESS to CSS 2013-09-27 16:11:28 +01:00
Rowan Manning
0a637752e3 Add better error stacks to the log 2013-09-27 15:24:48 +01:00
Rowan Manning
4f38eaecc4 Add a stack trace to the 500 page in dev mode 2013-09-27 15:14:49 +01:00
Rowan Manning
8e1dde9ec0 Add CSV download for results 2013-09-26 14:11:43 +01:00
Rowan Manning
00dbebc1a6 Add a skeleton page for individual results 2013-09-25 14:57:26 +01:00
Rowan Manning
f4ee07e955 Move task route/view into a subdirectory 2013-09-24 22:41:43 +01:00
Rowan Manning
23ffae54fa Add task deletion 2013-09-24 20:58:47 +01:00
perryharlock
eb7f7205f9 Add 404 and 500 routes 2013-09-24 15:24:54 +01:00
perryharlock
0d9a467663 Add url helper to simplify url names 2013-09-17 11:16:20 +01:00
Rowan Manning
b7cb3ab48a Lint JavaScript 2013-09-16 13:28:51 +01:00
Rowan Manning
7fd93d114f Make the "new task" form functional 2013-09-16 11:10:19 +01:00
Rowan Manning
a7aad37ea0 Add a view helper for date formatting 2013-09-16 10:26:21 +01:00
Rowan Manning
8d4f79128d Configure Express and add public files 2013-09-16 09:05:00 +01:00
Rowan Manning
f951f7c734 Add basic views 2013-09-13 17:20:38 +01:00
Rowan Manning
433aecd972 Initial commit 2013-09-13 16:49:19 +01:00