Commit Graph

63 Commits

Author SHA1 Message Date
Mrugesh Mohapatra
bd48d21776 fix(CI): switch checks high progress langs (#51415) 2023-08-28 21:23:54 +05:30
Mrugesh Mohapatra
2c37e18c7a fix(CI): adjust job queue and remove wasteful runs (#51404)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-08-28 16:48:51 +05:30
Mrugesh Mohapatra
f1ccccfee6 chore: rename workflow name 2023-08-27 17:49:33 +05:30
Mrugesh Mohapatra
cf4995fa83 fix: add build jobs to CI to make renovate behave (#51401) 2023-08-27 16:27:27 +05:30
renovate[bot]
904846476f chore(deps): update actions/checkout digest to f43a0e5 (#51377)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-26 15:17:29 +05:30
renovate[bot]
edec7ba661 chore(deps): update github actions 2023-08-19 11:48:19 +05:30
renovate[bot]
e97abd2a4e chore(deps): update github actions 2023-08-12 13:19:53 +05:30
renovate[bot]
3b091e84b0 chore(deps): update github actions 2023-07-08 03:37:04 +00:00
renovate[bot]
27135d67a6 chore(deps): update github actions (#50648)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-10 14:05:31 +05:30
Naomi Carrigan
389e83796d fix(tools): deduplicate workflows (#50520) 2023-05-26 15:07:38 +05:30
renovate[bot]
cf53cf2e22 chore(deps): update github actions (#50062)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-15 05:59:07 +05:30
Mrugesh Mohapatra
e5590e56d7 chore: use pnpm v8 for deps (#49892)
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2023-03-29 20:18:49 +05:30
renovate[bot]
f0106207ee chore(deps): update github actions (#49842)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-25 11:13:59 +05:30
Naomi Carrigan
1d616c733b feat(.github): comment on i18n failure (#49746)
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2023-03-24 07:14:06 +00:00
Oliver Eyton-Williams
a0f958189e chore: update api test suite and include it in run test (#49794) 2023-03-23 16:57:11 +00:00
renovate[bot]
e0be65b2d3 chore(deps): update github actions 2023-03-18 07:37:14 +00:00
Oliver Eyton-Williams
14286f6f8b chore(.github): cache pnpm store (#49637)
💸
2023-03-10 12:08:40 +00:00
Oliver Eyton-Williams
d7848ae01a feat: migrate to pnpm for better workspace DX (#49293)
* feat: npm -> pnpm 

This resolves the issues with the gatsby client (gatsby-plugin-pnpm
deals with the fact that gatsby is relying on its own dependencies
being de-duped)
and challenge-editor (which doesn't seem to want to automatically install
codemirror and needed its own eslint config)

* fix: correct mocha path for curriculum tests

* fix: use select workspace with -F not -w

* fix: reorganise packages and restrict hoisting

pnpm works best if the workspaces keep their own dependencies, since
dependencies are not flattened and then what node resolves from a
require is predictable.

@types seem to be a special case and more care is required to prevent
them getting smushed together in the root (hence the .npmrc)

* fix: add types for tools + root

* fix: decouple challenge-auditor from client

* fix: add ui-components types

* fix(client): use the latest types for react 16

* fix: prettify

* fix: prettierignore pnpm-lock

* fix: relax hoisting

Turns out pnpm works just fine with types. I don't know what was going
wrong before, but there are no-longer any type conflicts.

* fix: add @redux-saga/core to fix eslint issue

It seems to only be redux-saga that import/named can't cope with, so it
is probably okay to work around this one.

* chore: add chai to tools/scripts/build

* fix: add store to root for cypress

* fix: allow cypress to download binaries

If we want to keep preventing cypress from downloading binaries, we can
figure out a workaround, but I'm allowing it to ease the transition to
pnpm.

My guess about why this is happening is that npm triggers Cypress's
postinstall script, but pnpm does not (because pnpm install only
installs if necessary, perferring to link)

* chore: re-enable pre/post scripts

* fix: update build scripts for client

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>

* chore: update engines to use pnpm


* fix: enable choice of (super)block for tests

Only 'nix machines for now.

* chore: pin pnpm to version 7

* chore: remove last npms

Except web + curriculum-server. I'll update them when I start work on
them again.

* fix: lockfile check to catch any package-locks

* fix(action): install pnpm for upcoming tests

* chore: add nodemon to new api

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2023-03-02 18:17:44 +00:00
Mrugesh Mohapatra
51217a62db fix: update github actions trigger configs (#49328) 2023-02-13 16:56:48 +05:30
renovate[bot]
dca62c0430 chore(deps): update github actions (#48951)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-07 02:14:22 +00:00
Mrugesh Mohapatra
1d6e10c38c fix(ci): add node 18 build, test variants (#48117) 2022-12-19 20:29:50 +05:30
renovate[bot]
3d232a9d11 chore(deps): update github actions 2022-12-17 08:02:56 +00:00
Oliver Eyton-Williams
c8be10ca77 chore: make too many lockfiles error more explicit (#48748) 2022-12-13 21:43:53 +04:00
Shaun Hamilton
caf5dd72f9 chore(.github): disable tests on next-api, add label (#48435) 2022-11-09 00:27:50 +05:30
Mrugesh Mohapatra
47244a33d4 fix: drop npm caches in CI (#48369) 2022-11-02 16:41:55 +05:30
renovate[bot]
a7295b38e0 chore(deps): update github actions to 93ea575 (#48062)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-15 12:55:48 +00:00
renovate[bot]
e742ff1032 chore(deps): update actions/setup-node digest to 969bd26 2022-10-01 16:26:31 +00:00
Oliver Eyton-Williams
ea8ffd386e fix: download ram more often (#47524) 2022-09-15 11:22:59 -07:00
Naomi Carrigan
f9f9cae7e9 fix(tools): download more ram (#47508) 2022-09-13 09:41:49 +02:00
renovate[bot]
114e93e894 chore(deps): update actions/setup-node digest to 2fddd88 (#46903)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
2022-07-15 19:13:22 +05:30
Mrugesh Mohapatra
bbf21fec68 fix(actions): drop npm caching (#46480) 2022-06-13 17:57:21 +05:30
Mrugesh Mohapatra
0d88cb4b2d chore: rename actions for consistency 2022-06-13 15:12:53 +05:30
renovate[bot]
fecbf5fed0 chore(deps): update actions/setup-node digest to eeb10cf (#46449)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-06-12 01:14:55 +05:30
renovate[bot]
385816436f fix(deps): pin dependencies (#46128)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-05-24 12:57:08 +05:30
Oliver Eyton-Williams
cf4b9a1557 feat: client overhaul proof of concept (#45844)
* chore: initial setup of web package

This is *not* a workspace, yet, because it would be nice to use the
latest React, but /client can't migrate (yet).

Having two React versions creates issues in workspaces since /.bin/next
gets hoisted to root... and finds the root React version :(

* feat: add config for next

* fix: use jsx-runtime for web linting

* chore: init curriculum-server with json-server

* chore: integrate curriculum-server with TS/eslint

* feat: add patch script

json-server doesn't like keys with '/'s in so, for now I'm just patching
them out.

This lets us keep a strong separation between this WIP and the rest of
the code.

* fix: use port 8000 to avoid conflicts

* feat: crude ISR demo using challenge pages

* feat: extend ISR demo to use params

* feat: return props for specific superblocks

* chore: re-organise folders

* refactor: put data fetching in a single module

* refactor: challenge page slightly

* feat: add link to test ISR

You can see that, if you run next dev, the linked page gets regenerated
whenever you navigate to it.  However, if you run next build that is no
longer the case and the page has to be reloaded for the user to see the
latest version.

The implication is that we'll need another method (Web worker, probably)
to detect if the page needs to be updated.

* feat: render static paths for rwd

* feat: add monaco Editor

* feat: send less data via props

Rather than sending superblocks, this now sends blocks. Next step, just
the challenge!

* fix: only send individual challenge's data

* feat: send /learn/stuff/<id> to the challenge page

* fix: redirect to path with trailing id

* fix: handle all possible path prefixes

* feat: add superblocks with trailing ids

* chore: rename block -> blockOrId

* chore: remove logs

* fix: return notFound if page id is missing

* chore: add a note about increasing TS strictness

* feat: serverside redirects

This should be a touch more performant, but mostly it separates the
concerns.

Since the server already has the responsibility of choosing what pages
to render, redirects fit naturally with its concerns.

* refactor: clean up param validation

* feat: create list of blocks in superblock

* feat: add challenge links to map

* feat: link to full path, not just id

* refactor: ensure props match getStaticProps

By specifying the props for GetStaticProps we ensure that it returns the
expected data and use InferGetStaticPropsType to get the type out again
for use in the component

* feat: improve and document dev experience

* refactor: separate routing from rendering

* refactor: extract routing logic into functions

* refactor: naming consistency

* refactor: move data wrangling into get-curriculum

* refactor: align blockOrId and id

* chore: remove the server from workspaces

* chore: remove the lock

* docs: paths

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>

* chore: install before linting

* fix: create env.json before installing new client

* chore: ignore generated json file

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
2022-05-09 11:30:15 -05:00
Naveen
f2580f58a6 chore: set permissions for GitHub actions (#45876)
* chore: Set permissions for GitHub actions

 Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>

* Update .github/workflows/codeql-analysis.yml

Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>

* Update .github/workflows/labeler.yaml

Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>

* Update .github/workflows/node.js-tests-upcoming.yml

Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>

* Update .github/workflows/node.js-tests.yml

Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>

* Update .github/workflows/codeql-analysis.yml

Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>

* Update .github/workflows/labeler.yaml

Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>

* Update .github/workflows/labeler.yaml

Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>

Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
2022-05-08 15:17:44 +05:30
Oliver Eyton-Williams
4cc20172c5 fix: fallback to english challenges (#45635)
* fix: fallback to english challenges

All challenges will use the english version if a translated file is not
available.  SHOW_NEW_CURRICULUM still gates what's shown in the client.

* refactor: use closures to simplify createChallenge

* refactor: remove messy destructure

* refactor: add meta via helper

* fix: fallback to [] for meta.required

* fix: repair challenge.block

* refactor: use CONST_CASE for meta + challenge dirs

* fix: catch empty superblocks immediately

* fix: clean up path.resolves

* fix: invalid syntax in JS project steps

* fix: default to english comments and relax tests

Instead of always throwing errors when a comment is not translated, the
tests now warn while SHOW_UPCOMING_CHANGES is true, so that tests will
pass while we're developing and allow translators time to work.

They still throw when SHOW_UPCOMING_CHANGES is false to catch issues
in production

* test: update createCommentMap test

* refactor: delete stale comment

* refactor: clarify validate with explanatory consts

* feat: throw if audited cert falls back to english

* fix: stop testing upcoming localized curriculum
2022-04-15 09:17:49 -05:00
Oliver Eyton-Williams
f485bc1c16 chore: update CI tests (#45401)
* chore: echo npm version in CI (as debugging info)

* chore: remove redundant alterations to .env

sample.env already has SHOW_NEW_CURRICULUM=true
2022-03-10 10:09:06 -08:00
renovate[bot]
d96ab11ffd chore(deps): update actions/setup-node action to v3 (#45329)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-03-03 13:42:39 +05:30
renovate[bot]
15232456b1 chore(deps): update actions/checkout action to v3 (#45324)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-03-03 06:29:31 +00:00
Mrugesh Mohapatra
94be3c3e7d fix: ensure only one lockfile is used (#45230)
* fix: ensure only one lockfile is used

* fix: remove extra lockfiles
2022-02-24 09:23:30 +01:00
Oliver Eyton-Williams
7216ca55cc refactor: organise TypeScript config and migrate helpers (#44747)
* feat: allow more 1000 steps to be created at once

* refactor: start migrating to typescript

* refactor: delete-step to ts

* refactor: migrated some helpers

* refactor: migrate create-empty-steps

* refactor: migrate create-step-between

* refactor: finish migrating to TS

* refactor: migrate tests

* fix: ensure mock.restore is done after each test

* fix: prevent double-tscing

* fix: repair the tests

* chore: use ts-node for scripts

We don't need the performance boost of incremental compilation and
ts-node is easier to work with

* refactor: consolidate tsconfigs

* refactor: replace gulp

* fix: use ts-node for build-curriculum

* fix: allow ts compilation of config

* feat: create and use create:config script

* fix: add /config to eslint projects

* fix: remove gulp script
2022-01-25 11:34:16 +01:00
Oliver Eyton-Williams
36363f277d test: enable tests for steps (#44550)
* fix: handle missing solutions correctly

Rather than creating an [[]] the parser now creates [] which isEmpty().
This makes the test suite check the next challenge for a solution.

In addition, the logic for testing solutions was fixed.

* chore: update snapshots

* test: build new superblock in node.js-tests CI

* test: allow forward slash in superblock slug

* fix: borked tests oops

* test: ignore duplicated projects

* fix: i did not break these shaun did :)

* fix: idIndex is index of id not id

Co-authored-by: Nicholas Carrigan <nhcarrigan@gmail.com>
2021-12-22 12:18:06 -08:00
Oliver Eyton-Williams
48f88428e8 test: login more directly (#44467)
* test: login more directly

* test: separate login from other visits

In a single test, Cypress can only visit within a single domain, hence
the separation.

* chore: fail slowly for all strategies

* test: user certified user for showing cert

* test: fix and cleanup certifications
2021-12-11 14:34:16 +05:30
Mrugesh Mohapatra
4574e4e81d chore: update all workflows to Node.js v16 2021-11-03 15:06:19 +05:30
Mrugesh Mohapatra
f84d6078fd chore(actions): use Ubuntu-20.04 in all workflows (#44095) 2021-11-02 17:19:50 +05:30
Oscar Dominguez
93ad0ae036 ci(workflow): add cache to workflows using actions/setup-node (#43830) 2021-10-13 13:04:58 +05:30
Mrugesh Mohapatra
0a0caf18ae fix(actions): use inbuilt cache with setup-node (#42730) 2021-07-03 14:09:25 +01:00
Oliver Eyton-Williams
c69a1cb483 test: enable testing for upcoming challenges (#42360)
* test: enable testing for upcoming challenges

* fix: enable SHOW_UPCOMING_CHANGES during test

* Revert "fix: enable SHOW_UPCOMING_CHANGES during test"

This reverts commit f1bd00fdba.

* Revert "test: enable testing for upcoming challenges"

This reverts commit d0409fef66.

* feat: test upcoming changes in separate job
2021-06-08 16:57:27 +01:00
Nicholas Carrigan (he/him)
4ed75cb79f fix(tools): ignore renovate (#42008)
Ignore the branches renovate creates for the push events.
2021-05-06 00:20:38 +05:30