profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/vikaspotluri123/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Vikas Potluri vikaspotluri123 Qualcomm Austin, Texas https://vikaspotluri.me

swapagarwal/swag-for-dev 3887

😎 swag opportunities for developers

TryGhost/gscan 54

Ghost theme scanner - checks for errors and feature support

HexRweb/GhostHunter-server 5

Ghost Hunter as a serverside node application

HexRweb/exstatic 3

HexR's Static Site Generator. Opinionated and SEO friendly

vikaspotluri123/discourse-get-comment-count 3

A universal wrapper to dynamically update the number of comments an article has garnered from its Discourse counterpart

vikaspotluri123/gatekeeper 1

Modern, configurable access control via HTTP Basic Authentication

vikaspotluri123/ghost-cli-supervisor 1

Ghost CLI process manager that uses Supervisor to run Ghost

gradebook/legal 0

Legal information for Gradebook

vikaspotluri123/action-deploy-theme 0

:octocat: Deploy your Ghost theme with Github Actions

push eventvikaspotluri123/website

Vikas Potluri

commit sha 8048b951b29ef6a397ec354ddc1821fbcbf426ad

fix flipped selectors for dark / light mode gradient

view details

push time in 10 days

push eventvikaspotluri123/website

Vikas Potluri

commit sha 261e10fcce6c4c9218256ffa1372b52c272cc845

improve light mode gradient

view details

push time in 10 days

push eventvikaspotluri123/website

Vikas Potluri

commit sha 47f1829ecd07923a43d8cbd2cedc3a3ed5a13b1b

add randomness and depth to hero bg

view details

Vikas Potluri

commit sha f98d2ee23bebedd7e822cb65fbaedefee3ce4e00

update clip path removal cutoff

view details

Vikas Potluri

commit sha f8d30973c481c1eeac39ccacc2f95e2dbd9dd80e

update dark mode gradient stops

view details

Vikas Potluri

commit sha a474846d1be97237186e45cbfa7c1bae428b3cb5

switch from verb to noun of agency - the `I` is hard to see so just get rid of it :D

view details

Vikas Potluri

commit sha 5d210e6754215397fd5bbf3717d1e16c032c9cce

fix alignment issues for "verbs"

view details

Vikas Potluri

commit sha 0d2f6a97d2e42acfb33173b3797a68ee9f5713d0

copy updates

view details

Vikas Potluri

commit sha 71c6c4a5f48fa79353f142aab8026fea6f34ea90

bump deps + lock file maintenance

view details

push time in 11 days

push eventgradebook/server

Vikas Potluri

commit sha cfc5f4104d7026eadc4b1d67e6e606d7d40a0251

update live reload path

view details

push time in 11 days

push eventgradebook/server

Vikas Potluri

commit sha 4e3cae1db65d223405c25f92958af217b85d4788

move development-specific logic outside of lib

view details

Vikas Potluri

commit sha 0381df94de231242548fc9cf23c8ddd800c7c36e

fix 500 error with delay

view details

push time in 11 days

PullRequestReviewEvent

Pull request review commentTryGhost/Ghost-CLI

v1 Updates

 async function install(ui, task) { }  async function generateCert(ui, domain, webroot, email, staging) {-    const cmd = `/etc/letsencrypt/acme.sh --issue --home /etc/letsencrypt --domain ${domain} --webroot ${webroot} ` +-    `--reloadcmd "${nginxProgramName} -s reload" --accountemail ${email}${staging ? ' --staging' : ''}`;+    const parts = [+        '/etc/letsencrypt/acme.sh',+        '--issue',+        '--home /etc/letsencrypt',+        '--set-default-ca',

I think this is a top-level command (like --issue):

https://github.com/acmesh-official/acme.sh/blob/8fcecd59a0fd991f1fb4248692af63889bb90d81/acme.sh#L6931-L7002

acburdine

comment created time in 12 days

PullRequestReviewEvent

issue commentTryGhost/Ghost

Redirect loop when trying to redirect from /foo.bar/ to /foo-bar/

I'm guessing your redirect is interpreted as a regex - can you try this: /scatter\.fm/: /scatter-fm

mhansen

comment created time in 12 days

push eventvikaspotluri123/node-web-server

dependabot[bot]

commit sha a5f111a5975c046fe1588f38272ad1808c64c89f

Bump ansi-regex from 5.0.0 to 5.0.1 (#22) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

view details

push time in 20 days

PR merged vikaspotluri123/node-web-server

Bump ansi-regex from 5.0.0 to 5.0.1 dependencies

Bumps ansi-regex from 5.0.0 to 5.0.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/chalk/ansi-regex/releases">ansi-regex's releases</a>.</em></p> <blockquote> <h2>v5.0.1</h2> <h3>Fixes (backport of <code>6.0.1</code> to v5)</h3> <p>This is a backport of the <strong>minor</strong> ReDos vulnerability in <code>ansi-regex@<6.0.1</code>, as requested in <a href="https://github-redirect.dependabot.com/chalk/ansi-regex/issues/38">#38</a>.</p> <ul> <li>Fix <a href="https://en.wikipedia.org/wiki/ReDoS">ReDoS</a> in certain cases (<a href="https://github-redirect.dependabot.com/chalk/ansi-regex/issues/37">#37</a>) You are only really affected if you run the regex on untrusted user input in a server context, which it's very unlikely anyone is doing, since this regex is mainly used in command-line tools.</li> </ul> <p><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3807">CVE-2021-3807</a></p> <p><a href="https://github.com/chalk/ansi-regex/compare/v5.0.0..v5.0.1">https://github.com/chalk/ansi-regex/compare/v5.0.0..v5.0.1</a></p> <p>Thank you <a href="https://github.com/yetingli"><code>@​yetingli</code></a> for the patch and reproduction case!</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/chalk/ansi-regex/commit/a9babce885cf19c363cf1d1c645f834592c3f7a4"><code>a9babce</code></a> 5.0.1</li> <li><a href="https://github.com/chalk/ansi-regex/commit/4657833b3419f381c8ef4eb5787e71c5206b1b35"><code>4657833</code></a> fix incorrect format</li> <li><a href="https://github.com/chalk/ansi-regex/commit/c3c0b3f2736b9c01feec0fef33980c43720dcde8"><code>c3c0b3f</code></a> Fix potential ReDoS (<a href="https://github-redirect.dependabot.com/chalk/ansi-regex/issues/37">#37</a>)</li> <li><a href="https://github.com/chalk/ansi-regex/commit/178363b3a297b712a0054e702d8ddde3879913e5"><code>178363b</code></a> Move to GitHub Actions (<a href="https://github-redirect.dependabot.com/chalk/ansi-regex/issues/35">#35</a>)</li> <li><a href="https://github.com/chalk/ansi-regex/commit/0755e661553387cfebcb62378181e9f55b2567ff"><code>0755e66</code></a> Add <a href="https://github.com/Qix"><code>@​Qix</code></a>- to funding.yml</li> <li>See full diff in <a href="https://github.com/chalk/ansi-regex/compare/v5.0.0...v5.0.1">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.

</details>

+3 -3

0 comment

1 changed file

dependabot[bot]

pr closed time in 20 days

push eventvikaspotluri123/node-web-server

dependabot[bot]

commit sha 0826e51ebc4e724644e571c7792e4ee96883234c

Bump node-windows from 1.0.0-beta.5 to 1.0.0-beta.6 (#21) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

view details

push time in 20 days

PR merged vikaspotluri123/node-web-server

Bump node-windows from 1.0.0-beta.5 to 1.0.0-beta.6 dependencies

Bumps node-windows from 1.0.0-beta.5 to 1.0.0-beta.6. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/coreybutler/node-windows/releases">node-windows's releases</a>.</em></p> <blockquote> <h2>1.0.0-beta.6</h2> <p>Security updates.</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/coreybutler/node-windows/commit/a379d31366edbd7a672a981e6c09e185ab448dd3"><code>a379d31</code></a> prevent arbitrary command execution.</li> <li><a href="https://github.com/coreybutler/node-windows/commit/00f6bc8baa6ebaa7705706016096d21f7c9022f8"><code>00f6bc8</code></a> Update README.md</li> <li>See full diff in <a href="https://github.com/coreybutler/node-windows/compare/1.0.0-beta.5...1.0.0-beta.6">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

+5 -5

0 comment

2 changed files

dependabot[bot]

pr closed time in 20 days

push eventvikaspotluri123/Ghost-Admin

Sam Lord

commit sha 2047f292402352ddc88c6eb886f1dbf05b27530c

v4.9.3

view details

Renovate Bot

commit sha e2a4a6dabae99a0be8d53fcf0a7e8e2465032c0c

Lock file maintenance

view details

Daniel Lockyer

commit sha 533d33d28bc33956186620616c13d6dbcbe47d72

Merged v4.9.3 into main v4.9.3

view details

renovate[bot]

commit sha 25019241f97e7c396f3e13e810fc0dff0972498f

Update dependency @sentry/ember to v6.9.0 (#2037) Co-authored-by: Renovate Bot <bot@renovateapp.com>

view details

Thibaut Patel

commit sha 48d092a436d9ad8b9a8684f33475f6943c9efb98

Renamed isAdmin/isOwner/isAdminOrOwner to reduce confusion issue https://github.com/TryGhost/Team/issues/857 - The goal is to avoid testing for the owner role only is cases where we should be testing for the owner or admin role - `isOwner` => `isOwnerOnly` - `isAdmin` => `isAdminOnly` - `isOwnerOrAdmin` => `isAdmin` (concerns now both Owner and Admins)

view details

Kevin Ansfield

commit sha c98bce629a45c0e5377cd8093dc575bef2dfaa47

Dropped use of @classic decorator in <GhTokenInput> no issue - updated component to be a glimmer component and use full "Octane" syntax

view details

Daniel Lockyer

commit sha 63193dc815552ad08cc4e0b559043ae31596609e

v4.9.4

view details

Daniel Lockyer

commit sha 8d4cc506a75b602242812341e500fc2a2773c228

Merged v4.9.4 into main v4.9.4

view details

Kevin Ansfield

commit sha 2cb85abc24fcf5421a93ec049f848347b110068b

Fixed new post screen showing 500 error refs https://github.com/TryGhost/Admin/commit/2663f5bbb1bd4b94f921bc4450108d2edb5cfa22 - `return` value was missing from `editor.new` route

view details

Kevin Ansfield

commit sha 76a9f0245cad4d7e5208ca72553d68a286ff9fda

Fixed editor error when deleting a card via DEL key with no following section refs https://github.com/TryGhost/Team/issues/747 - we were assuming that a next section exists, when it didn't we'd error trying to read `type` of `undefined`

view details

Sanne de Vries

commit sha dbd05286701ee956beb03cc7453d38cbba605216

Adjusted feature image button to always be visible on mobile

view details

Sanne de Vries

commit sha d45ca5501ed9176dc6316068f067eaf335803400

Updated feature image Unsplash integration to appear on post title hover

view details

Kevin Ansfield

commit sha 47826c45cd3c3406c32679479fcff53025fca465

🐛 Fixed re-authenticate modal not showing when saving in editor closes https://github.com/TryGhost/Team/issues/865 Ghost now returns a forbidden error rather than an unauthorized error when saving whilst logged out so the session invalidation was not being triggered. - added forbidden check to ajax service to trigger session invalidation - added automatic retry of save in editor when re-authenticating - fixed re-population of user and proxy services when re-authenticating, it's not needed at that point because nothing has been cleared

view details

Kevin Ansfield

commit sha a2cb3bc392026256a1dee2cbb55f89176d45292e

Fixed tests refs https://github.com/TryGhost/Admin/commit/47826c45cd3c3406c32679479fcff53025fca465 - referenced commit introduced an early return when invalidating session on a failed ajax request so that error alerts weren't shown when re-authenticating. This had an unintended side-effect of breaking invalidation when not re-authenticating and redirecting to signin screen

view details

Kevin Ansfield

commit sha 0e99d58ae11bec37d6dcd9748aadd3aa9262f2cd

Fixed more tests refs https://github.com/TryGhost/Admin/commit/47826c45cd3c3406c32679479fcff53025fca465 - referenced commit skipped current user and proxy service population when `skipAuthSuccessHandler` was set but the population is needed during setup - `skipAuthSuccessHandler` is used for skipping the post-authentication transition rather than skipping all post-auth behaviour so the the post-auth behaviour was reintroduced but put in a guard so we don't try to do it again when it's already been run

view details

Kevin Ansfield

commit sha d3b86be602c64277759ecf899e11509e3ad3564f

Fixed error when resizing browser after pasting embed link closes https://github.com/TryGhost/Team/issues/749 - resize event listener is created twice when converting a link to an embed card, if we don't clear the older resize event handler before creating a new one then it persists after the component is torn down and the iframe no longer exists

view details

Kevin Ansfield

commit sha 99391b161d9e57825cc3943a700e5083429d0c47

Fixed transformer error when saving invalid twitter/facebook URLs closes https://github.com/TryGhost/Team/issues/746 - `.match()` returns `null` if there's no match which then breaks the array destructuring

view details

Kevin Ansfield

commit sha f85f1b38e92531a25b1b2729625dcb3189f69345

Fixed error when entering invalid URL in canonical URL field closes https://github.com/TryGhost/Team/issues/745 - `URL()` will throw when given something it doesn't understand. As `seoURL` is just a display property it doesn't matter, we can catch the error and do nothing

view details

Kevin Ansfield

commit sha 6a16a92a96bd058fc297712f5efeb9c43653295c

Fixed error when interacting with tag accent color input closes https://github.com/TryGhost/Team/issues/744 - we were using `{{on}}` with a function on the component that wasn't bound to `this` via the `action` decorator meaning errors were thrown every time the input lost focus

view details

Kevin Ansfield

commit sha 7172715c344ce9676c60d33f256b1b48cbcec03f

Bumped eslint-plugin-ghost and fixed linter errors no issue - new linting rules that needed fixing: - calling `super` in lifecycle hooks - no usage of String prototype extensions

view details

push time in a month

push eventvikaspotluri123/Ghost

Naz

commit sha 77a5ea5659e657e461274da5d7619cb94d1ab502

Added JSDoc to addTable method no issue - This mehod has an important `tableSpec` parameter which MUST be present when creating a new table migration. Having a description in form of the JSDoc somewhat helps this cause - Next best improvement would be throwing an error if the parameter wasn't present, but that would require a bigger refactor backporting all usages of `addTable` method

view details

Naz

commit sha bfb899b29334bea20944a72c6d73453af6e34def

Removed stray code refs https://github.com/TryGhost/Ghost/commit/77a5ea5659e657e461274da5d7619cb94d1ab502 - This part was misscommited, wasn't meant for main

view details

Naz

commit sha 8f5d6ebf8c2d2b517827b08a2a71d5ec312127dc

Removed use of deprecated new Error() syntax refs https://github.com/TryGhost/Ghost/commit/2f1123d6ca7894fc21499739f46f0ae5c9eda73a refs https://github.com/TryGhost/Ghost/commit/6f1a3e17749e878a379830f12672b266c15bc835 - The use of new Error() has been deprecated. Refactoring the migration to use `createIrreversibleMigration` made most sense to have central error handling for migration which are not meant to be reverted.

view details

Naz

commit sha 3b7042545ab1431ce6c0f85fc48f858a03691794

Fixed typo

view details

Naz

commit sha f343e73c922367d4d4d33aa28b7b3be9c40277e2

Removed use of deprecated new Error() syntax refs https://github.com/TryGhost/Ghost/commit/2f1123d6ca7894fc21499739f46f0ae5c9eda73a refs https://github.com/TryGhost/Ghost/commit/6f1a3e17749e878a379830f12672b266c15bc835 - As per refed commits, we are removing deprecated use of `new Error()` in the codebase - This bit cleans up `new Error()` usage in MEGA service

view details

Naz

commit sha b0451129502b2eb66522a2939dc35a66082345c1

Renamed exposed _getEmailMemberRows in mega no issue - Exposing internal methods out of the module is a non-standard practice. Adding `_` prefix allows to signal that this method is not for general use. - When mega is refactored into a proper class this method will become exposed anyways

view details

Naz

commit sha 5ea8e9b9264deed283fc6a76d08d2c5e3c3fe5db

Removed use of deprecated new Error() syntax refs https://github.com/TryGhost/Ghost/commit/2f1123d6ca7894fc21499739f46f0ae5c9eda73a refs https://github.com/TryGhost/Ghost/commit/6f1a3e17749e878a379830f12672b266c15bc835 - As per refed commits, we are removing deprecated use of `new Error()` in the codebase - This bit cleans up the rest of `new Error()` usage in MEGA service

view details

Fabien O'Carroll

commit sha 62ee693310af076cefbb2e8c87cb6d5f8e42ebdd

Lazily instantiated express-session middleware refs https://github.com/TryGhost/Team/issues/756 When running the tests it was possible for this middleware to be instantiated before the settings cache, resulting in an undefined 'session_secret' setting being passed. This would cause tests to fail. Tracking this down proved difficult, so the fix was made here, by instantiating the express-session middleware only once a request needs to use it, we can be confident that Ghost has completely started.

view details

Kevin Ansfield

commit sha 9c5a25b06069d721e452d8a023223757ce278e10

🐛 Fixed `alt="null"` for feature image in emails no issue - when no alt text was set for feature images we were incorrectly rendering `alt="null"` in emails

view details

Naz

commit sha 9870aff8f03f9215802d969f9326ac475682c39b

Fixed slow-running scheduling default test refs https://github.com/TryGhost/Team/issues/860 - Slow unit tests cause longer waiting time to deliver code to main. Before this fix the test was taking a whooping 6s on average - The main cause of the delay was a downstream's package (got) default retry logic that was taking up a lot of time bypassing the retry logic present in the default scheduler itself

view details

Naz

commit sha 84d0815e47e6a76455ec90b7d215b39e5ff55344

Refactored scheduling default test to use nock refs https://github.com/TryGhost/Team/issues/860 - `nock` has been used in other similar unit tests. It was proven to have easy to understand and use API. By not making up custom code through express/httpServer stuff we reduce the amount of boilerplate code significantly - makes tests a lot more readable - Bonus, removes couplint dependency to "shared" express module

view details

Naz

commit sha 8a219f4f72633aac59dc394e23dc2051d775e544

Fixed slow-running external request test refs https://github.com/TryGhost/Team/issues/860 - Slow unit tests cause longer waiting time to deliver code to main. Before this fix the test was taking a whooping 6s on average - The main cause of the delay was a downstream's package (got) default retry logic that was taking up a lot of time. The test is meant to check a "500" response handling not a retry logic, so disabling it for this specific test makes sense

view details

Naz

commit sha 20aea8c819997d8fa33a7056959e64f278132d43

Decreased unit test's timeout refs https://github.com/TryGhost/Team/issues/860 - As major slow test have been refactored making the timeout stricter will enforce better quality unit tests in the future

view details

Fabien 'egg' O'Carroll

commit sha 71ba9f3d1746f685e269cb2ef1c633b4a9eca7ef

Readded support for comped status in event aggregate (#13142) refs https://github.com/TryGhost/Team/issues/880 The aggregate for `paid_delta` was incorrect as it did not handle the case where an event went from paid->comped or from comped->paid. This resulted in an overcount for paid members.

view details

Kevin Ansfield

commit sha 9b963cef632f827e8cdd74067507f65eaec6aed1

Added `featureImgDragDrop` alpha labs flag refs https://github.com/TryGhost/Team/issues/884 - used by Admin whilst working on drag/drop support and design

view details

Fabien O'Carroll

commit sha 7eb821b3f5fca01565f6538e7a9fd723c31cde0e

Fixed created_at dates for member events on import refs https://github.com/TryGhost/Team/issues/542 The members-api has been updated to use the passed `created_at` property when creating members for the status change events, as well as using the subscription start_date for members paid subscription events

view details

Fabien O'Carroll

commit sha 768709ce88f9b61ec01b0086ec32d6b9af483857

Revert "Fixed created_at dates for member events on import" This reverts commit 7eb821b3f5fca01565f6538e7a9fd723c31cde0e. This package version is broken.

view details

Rishabh

commit sha 07dd783a40f118f34a287734654fde2bff340bca

🐛 Fixed error on saving member with existing label closes https://github.com/TryGhost/Team/issues/743 Unlike tags, a label has a unique constraint on its `name`. So saving a new label on member with the same name as existing label fails with error due to unique constraint error. - adds id for new label to match existing label if they are the same name, which avoids creating a new label

view details

Fabien 'egg' O'Carroll

commit sha 81e7d71391644b4586884db9925761ff2dbbbed9

Fixed created_at dates for member events on import (#13151) refs https://github.com/TryGhost/Team/issues/542 The members-api has been updated to use the passed `created_at` property when creating members for the status change events, as well as using the subscription start_date for members paid subscription events This is a duplicate of 7eb821b3f5fca01565f6538e7a9fd723c31cde0e but with updated dependencies.

view details

renovate[bot]

commit sha a292a4ba18131ab660f7307454dcaa67f974e887

Update dependency eslint-plugin-ghost to v2.5.0 (#13149) Co-authored-by: Renovate Bot <bot@renovateapp.com> This version of eslint contains changes for Admin only

view details

push time in a month

push eventgradebook/server

Vikas Potluri

commit sha 212a197dabb0a064eca7bc7784729e15c450d7c7

:fire: remove legacy course create endpoints

view details

Vikas Potluri

commit sha b0abbe4d8d13ee77125bb56a9ce45a984175f041

add completeCourseCreate endpoint

view details

Vikas Potluri

commit sha 2340544869bf828405189a04f7a0589fa85e6bd8

add pipeline check for missing controller

view details

push time in a month

delete branch gradebook/server

delete branch : faster-course-complete

delete time in a month

PR merged gradebook/server

add completeCourseCreate endpoint

Merge type: rebase Reviewers: 1

Suggest to review commit-by-commit

+460 -169

0 comment

21 changed files

vikaspotluri123

pr closed time in a month

Pull request review commentgradebook/server

add completeCourseCreate endpoint

+// @ts-check+const settings = require('../../settings');+const errors = require('../../../errors');+const ajv = require('../schema-validator');++const context = 'Validate course create';++module.exports.context = context;++/**+ * @description Ensures that cutoffs are valid json and match the course.cutoffs schema+ * @param {string} cutoffs+ * @returns {void}+ */+module.exports.validateCutoffs = cutoffs => {+	// CASE: Courses that do not include a query.type are treated as guided, the strictest schema.+	let parsedCutoffs = {};+	// If invalid JSON is sent we catch when JSON.parse() fails and throw an error+	try {+		parsedCutoffs = JSON.parse(cutoffs);+	} catch {+		throw new errors.ValidationError({+			context,+			message: 'cutoffs are not valid JSON',+		});+	}++	// @ts-expect-error+	// Validate cutoffs separately from the rest of the course since they had to be parsed first+	ajv.validateSchemeOrDie('course.cutoffs', parsedCutoffs);+};++module.exports.validateCategoryLimits = categoryList => {+	const maxCategories = settings.get('max_categories_per_course', 10);+	const maxGradesPerCategory = settings.get('max_grades_per_category', 10);++	if (categoryList.length > maxCategories) {+		throw new errors.ValidationError({+			context,+			message: `Course has too many categories, max is ${maxCategories}`,+		});+	}++	for (const category of categoryList) {+		if (category.numGrades > maxGradesPerCategory) {
POST /api/v0/category/:id
{
  "dropped": 100
}
vikaspotluri123

comment created time in a month

PullRequestReviewEvent

Pull request review commentgradebook/server

add completeCourseCreate endpoint

+// @ts-check+const settings = require('../../settings');+const errors = require('../../../errors');+const ajv = require('../schema-validator');++const context = 'Validate course create';++module.exports.context = context;++/**+ * @description Ensures that cutoffs are valid json and match the course.cutoffs schema+ * @param {string} cutoffs+ * @returns {void}+ */+module.exports.validateCutoffs = cutoffs => {+	// CASE: Courses that do not include a query.type are treated as guided, the strictest schema.+	let parsedCutoffs = {};+	// If invalid JSON is sent we catch when JSON.parse() fails and throw an error+	try {+		parsedCutoffs = JSON.parse(cutoffs);+	} catch {+		throw new errors.ValidationError({+			context,+			message: 'cutoffs are not valid JSON',+		});+	}++	// @ts-expect-error+	// Validate cutoffs separately from the rest of the course since they had to be parsed first+	ajv.validateSchemeOrDie('course.cutoffs', parsedCutoffs);+};++module.exports.validateCategoryLimits = categoryList => {+	const maxCategories = settings.get('max_categories_per_course', 10);+	const maxGradesPerCategory = settings.get('max_grades_per_category', 10);++	if (categoryList.length > maxCategories) {+		throw new errors.ValidationError({+			context,+			message: `Course has too many categories, max is ${maxCategories}`,+		});+	}++	for (const category of categoryList) {+		if (category.numGrades > maxGradesPerCategory) {

Actually, now that I think about it, since this is purely a UI thing, and we don't validate when setting the individual settings, I don't think it's needed... what do you think?

vikaspotluri123

comment created time in a month

PullRequestReviewEvent

Pull request review commentgradebook/server

add completeCourseCreate endpoint

+// @ts-check+const settings = require('../../settings');+const errors = require('../../../errors');+const ajv = require('../schema-validator');++const context = 'Validate course create';++module.exports.context = context;++/**+ * @description Ensures that cutoffs are valid json and match the course.cutoffs schema+ * @param {string} cutoffs+ * @returns {void}+ */+module.exports.validateCutoffs = cutoffs => {+	// CASE: Courses that do not include a query.type are treated as guided, the strictest schema.+	let parsedCutoffs = {};+	// If invalid JSON is sent we catch when JSON.parse() fails and throw an error+	try {+		parsedCutoffs = JSON.parse(cutoffs);+	} catch {+		throw new errors.ValidationError({+			context,+			message: 'cutoffs are not valid JSON',+		});+	}++	// @ts-expect-error+	// Validate cutoffs separately from the rest of the course since they had to be parsed first+	ajv.validateSchemeOrDie('course.cutoffs', parsedCutoffs);+};++module.exports.validateCategoryLimits = categoryList => {+	const maxCategories = settings.get('max_categories_per_course', 10);+	const maxGradesPerCategory = settings.get('max_grades_per_category', 10);++	if (categoryList.length > maxCategories) {+		throw new errors.ValidationError({+			context,+			message: `Course has too many categories, max is ${maxCategories}`,+		});+	}++	for (const category of categoryList) {+		if (category.numGrades > maxGradesPerCategory) {

I'll do that after this is merged 👍🏾

vikaspotluri123

comment created time in a month

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentgradebook/server

add completeCourseCreate endpoint

 module.exports.mount = app => { 	});  	app.put('/api/v0/courses', createCourse);-	app.put('/api/v0/courses/legacy', pipeline({-		permission: 'createCourse',-		validation: 'legacyCreateCourse',-		controller: course.legacyCreate,++	app.post('/api/v0/course/:id/complete', pipeline({+		validation: 'finishCreatingCourse',+		controller: course.complete,

Oops 👀

vikaspotluri123

comment created time in a month

push eventgradebook/server

Vikas Potluri

commit sha f330263120d5578d9a093f42cae0f31806c818a9

:fire: remove legacy course create endpoints

view details

Vikas Potluri

commit sha 0e7ce5bb318a3b7469d227ef1830f97ea9d3722c

add completeCourseCreate endpoint

view details

Vikas Potluri

commit sha 87c2e012d97924cdd87a3100ec7792c5c70df8a1

add pipeline check for missing controller

view details

push time in a month

Pull request review commentgradebook/server

add completeCourseCreate endpoint

 export interface ICreateCourseData { 	}; 	categories: ICategoryConfig[]; }++export interface ICompleteCourseCreateData extends Pick<ICreateCourseData, 'categories' | 'user'> {

I'm hesitant to do so since it "says" what's happening rather than contextualizing, and in this case there doesn't seem to be too much of a requirement for contextualization

vikaspotluri123

comment created time in a month

PullRequestReviewEvent

Pull request review commentgradebook/server

add completeCourseCreate endpoint

+// @ts-check+const semesterService = require('@gradebook/time').semester.data;+const knex = require('../../database/knex');+const {course: {response: Model}} = require('../../models');+const permissionWrap = require('./wrap');++module.exports = permissionWrap(async ({user, objectId: id}, db = null) => {+	const course = await knex({db, table: 'courses'})+		.select('courses.*')+		.count('categories.id as categories')

Yes, but this only works because of the inner join on the categories table 🙂

vikaspotluri123

comment created time in a month