Skip to content

Commit

Permalink
Spelling (#637)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: testing function `addAndRemoveRepositoryCollaborator` has had its spelling corrected. 

* spelling: correct

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: fixture

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: programmatically

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: project

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: references

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: repository

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: search

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: values

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: varnish headers

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: zero

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: zeros

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

---------

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Co-authored-by: Keegan Campbell <me@kfcampbell.com>
  • Loading branch information
jsoref and kfcampbell committed Mar 4, 2024
1 parent d653858 commit f70cecd
Show file tree
Hide file tree
Showing 15 changed files with 74 additions and 74 deletions.
8 changes: 4 additions & 4 deletions HOW_IT_WORKS.md
Expand Up @@ -12,7 +12,7 @@
`@octokit/fixtures` provides fixtures that can be used by automated tests for
GitHub API clients.

The fixtures are recorded programatically
The fixtures are recorded programmatically
by sending requests against the [GitHub REST API](https://developer.github.com/v3/)
and recording both requests and responses into JSON files. Each scenario has their own folder in the [scenarios/<host>/ folder](scenarios/)). Each of these folders contains 4 files:

Expand Down Expand Up @@ -91,7 +91,7 @@ of the `@octokit/fixtures` package and notify developers of the update.
- **All IDs are set to 1000** or above. The ID increments for each entity of the
same type within the same scenario
- **All Node IDs are set to `MDA6RW50aXR5MQ==`** which is the base64 string for `00:Entity1`.
- **Tokens Authorization Header are zerofied** ending with the token number, see [environment variables below](CONTRIBUTING.md#test-users--organization--tokens)
- **Tokens Authorization Header are zeros** ending with the token number, see [environment variables below](CONTRIBUTING.md#test-users--organization--tokens)
e.g. `FIXTURES_USER_A_TOKEN_FULL_ACCESS` becomes `0000000000000000000000000000000000000001`,
`FIXTURES_USER_B_TOKEN_FULL_ACCESS` becomes `0000000000000000000000000000000000000002`, etc
- **All timestamps are set to the time of the GitHub Universe 2017 keynote**
Expand All @@ -111,10 +111,10 @@ of the `@octokit/fixtures` package and notify developers of the update.
- **URLs containing temporary repository names** in response properties, paths
and location header are renamed,
e.g. `tmp-scenario-create-file-20170930034241803` is renamed to `create-file`.
- **Commit sha hashes** are zerofied with a counter,
- **Commit sha hashes** are zeros with a counter,
e.g. `3f3f005b29247e51a4f4d6b8ce07b67646cd6074` becomes `0000000000000000000000000000000000000001`,
the next unique commit sha becomes `0000000000000000000000000000000000000002`, etc.
- **GitHub Request IDs** are zerofied,
- **GitHub Request IDs** are zeros,
e.g. `DDA3:292D9:5B9AC0:62137E:5A022DD0` becomes `0000:00000:0000000:0000000:00000000`

## Cron job
Expand Down
2 changes: 1 addition & 1 deletion lib/fixturize-commit-sha.js
@@ -1,6 +1,6 @@
export default fixturizeCommitSha;

// We keep track of commit sha hashes. We don’t want to simply zerofy them as
// We keep track of commit sha hashes. We don’t want to simply zero them as
// there can be multiple commits. So instead we keep state of a counter and
// pad the counter with 0s left.
function fixturizeCommitSha(map, sha) {
Expand Down
4 changes: 2 additions & 2 deletions lib/normalize/archive.js
Expand Up @@ -15,7 +15,7 @@ async function normalizeArchive(scenarioState, response, fixture) {
]
// normalize folder name in file name
.replace(regex, "$1")
// zerofy sha
// zero sha
.replace(/archive-\w{7}/, "archive-0000000");

const extract = _extract();
Expand All @@ -31,7 +31,7 @@ async function normalizeArchive(scenarioState, response, fixture) {
header.name = header.name
// normalize folder name in path
.replace(regex, "$1")
// zerofy sha in path
// zero sha in path
.replace(/-(\w){7}\//, "-0000000/");

// normalize mtime
Expand Down
2 changes: 1 addition & 1 deletion lib/normalize/error.js
Expand Up @@ -3,6 +3,6 @@ export default normalizeContent;
import setIfExists from "../set-if-exists.js";

function normalizeContent(scenarioState, response) {
// zerofy request ID
// zero request ID
setIfExists(response, "request_id", "0000:00000:0000000:0000000:00000000");
}
4 changes: 2 additions & 2 deletions lib/normalize/index.js
Expand Up @@ -44,7 +44,7 @@ async function normalize(scenarioState, fixture) {
// Set used rate limit to 1
setIfExists(fixture.headers, "x-ratelimit-used", 1);

// zerofy random stuff
// zero random stuff
setIfExists(fixture.headers, "etag", '"00000000000000000000000000000000"');
setIfExists(fixture.headers, "x-runtime-rack", "0.000000");
setIfExists(
Expand Down Expand Up @@ -136,7 +136,7 @@ async function normalize(scenarioState, fixture) {
}
}

// remove varnishs header if present
// remove varnish headers if present
setIfExists(fixture.headers, "x-varnish", "1000");
setIfExists(fixture.headers, "age", "0");

Expand Down
2 changes: 1 addition & 1 deletion lib/remove-credentials.js
Expand Up @@ -10,7 +10,7 @@ const tokenToFixture = {
};

function removeCredentials(fixture) {
// zerofy auth token
// zero auth token
fixture.reqheaders.authorization = (
fixture.reqheaders.authorization || ""
).replace(/^token (\w{40})$/, (_, token) => {
Expand Down
@@ -1,4 +1,4 @@
export default addAndRemoveRepostioryCollaborator;
export default addAndRemoveRepositoryCollaborator;

import env from "../../../lib/env.js";
import getTemporaryRepository from "../../../lib/temporary-repository.js";
Expand All @@ -9,7 +9,7 @@ import getTemporaryRepository from "../../../lib/temporary-repository.js";
// - As user A, list collaborators (now includes user B)
// - As user A, remove user B as collaborator from repository
// - As user A, list collaborators (no longer includes user B)
async function addAndRemoveRepostioryCollaborator(state) {
async function addAndRemoveRepositoryCollaborator(state) {
// create a temporary repository
const temporaryRepository = getTemporaryRepository({
request: state.request,
Expand Down
4 changes: 2 additions & 2 deletions scenarios/api.github.com/add-labels-to-issue/record.js
@@ -1,10 +1,10 @@
export default addAndRemoveRepostioryCollaborator;
export default addAndRemoveRepositoryCollaborator;
import env from "../../../lib/env.js";
import getTemporaryRepository from "../../../lib/temporary-repository.js";

// - create issue
// - add labels to issue
async function addAndRemoveRepostioryCollaborator(state) {
async function addAndRemoveRepositoryCollaborator(state) {
let error;
// create a temporary repository
const temporaryRepository = getTemporaryRepository({
Expand Down
2 changes: 1 addition & 1 deletion scenarios/api.github.com/git-refs/record.js
Expand Up @@ -16,7 +16,7 @@ async function gitRefs(state) {

try {
// https://developer.github.com/v3/repos/contents/#create-a-file
// (these requests get ignored, we need two commits to test our refrences)
// (these requests get ignored, we need two commits to test our references)
const {
data: {
commit: { sha: sha1 },
Expand Down
100 changes: 50 additions & 50 deletions scenarios/api.github.com/project-cards/raw-fixture.json
Expand Up @@ -3,13 +3,13 @@
"scope": "https://api.github.com:443",
"method": "post",
"path": "/orgs/octokit-fixture-org/repos",
"body": { "name": "tmp-scenario-prooject-cards-20220719043919621-jyt6q" },
"body": { "name": "tmp-scenario-project-cards-20220719043919621-jyt6q" },
"status": 201,
"response": {
"id": 515436055,
"node_id": "R_kgDOHrjuFw",
"name": "tmp-scenario-prooject-cards-20220719043919621-jyt6q",
"full_name": "octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q",
"name": "tmp-scenario-project-cards-20220719043919621-jyt6q",
"full_name": "octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q",
"private": false,
"owner": {
"login": "octokit-fixture-org",
Expand All @@ -31,53 +31,53 @@
"type": "Organization",
"site_admin": false
},
"html_url": "https://github.com/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q",
"html_url": "https://github.com/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q",
"description": null,
"fork": false,
"url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q",
"forks_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/forks",
"keys_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/teams",
"hooks_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/hooks",
"issue_events_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/issues/events{/number}",
"events_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/events",
"assignees_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/assignees{/user}",
"branches_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/branches{/branch}",
"tags_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/tags",
"blobs_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/statuses/{sha}",
"languages_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/languages",
"stargazers_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/stargazers",
"contributors_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/contributors",
"subscribers_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/subscribers",
"subscription_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/subscription",
"commits_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/contents/{+path}",
"compare_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/merges",
"archive_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/downloads",
"issues_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/issues{/number}",
"pulls_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/pulls{/number}",
"milestones_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/milestones{/number}",
"notifications_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/labels{/name}",
"releases_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/releases{/id}",
"deployments_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/deployments",
"url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q",
"forks_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/forks",
"keys_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/teams",
"hooks_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/hooks",
"issue_events_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/issues/events{/number}",
"events_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/events",
"assignees_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/assignees{/user}",
"branches_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/branches{/branch}",
"tags_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/tags",
"blobs_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/statuses/{sha}",
"languages_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/languages",
"stargazers_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/stargazers",
"contributors_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/contributors",
"subscribers_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/subscribers",
"subscription_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/subscription",
"commits_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/contents/{+path}",
"compare_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/merges",
"archive_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/downloads",
"issues_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/issues{/number}",
"pulls_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/pulls{/number}",
"milestones_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/milestones{/number}",
"notifications_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/labels{/name}",
"releases_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/releases{/id}",
"deployments_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/deployments",
"created_at": "2022-07-19T04:39:19Z",
"updated_at": "2022-07-19T04:39:19Z",
"pushed_at": "2022-07-19T04:39:20Z",
"git_url": "git://github.com/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q.git",
"ssh_url": "git@github.com:octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q.git",
"clone_url": "https://github.com/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q.git",
"svn_url": "https://github.com/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q",
"git_url": "git://github.com/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q.git",
"ssh_url": "git@github.com:octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q.git",
"clone_url": "https://github.com/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q.git",
"svn_url": "https://github.com/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q",
"homepage": null,
"size": 0,
"stargazers_count": 0,
Expand Down Expand Up @@ -160,7 +160,7 @@
"X-Accepted-OAuth-Scopes",
"public_repo, repo",
"Location",
"https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q",
"https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q",
"X-GitHub-Media-Type",
"github.v3; format=json",
"X-RateLimit-Limit",
Expand Down Expand Up @@ -209,13 +209,13 @@
{
"scope": "https://api.github.com:443",
"method": "post",
"path": "/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/projects",
"path": "/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/projects",
"body": { "name": "Example project" },
"status": 201,
"response": {
"owner_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q",
"owner_url": "https://api.github.com/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q",
"url": "https://api.github.com/projects/14592722",
"html_url": "https://github.com/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q/projects/1",
"html_url": "https://github.com/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q/projects/1",
"columns_url": "https://api.github.com/projects/14592722/columns",
"id": 14592722,
"node_id": "PRO_kwLOHrjuF84A3qrS",
Expand Down Expand Up @@ -1280,7 +1280,7 @@
{
"scope": "https://api.github.com:443",
"method": "delete",
"path": "/repos/octokit-fixture-org/tmp-scenario-prooject-cards-20220719043919621-jyt6q",
"path": "/repos/octokit-fixture-org/tmp-scenario-project-cards-20220719043919621-jyt6q",
"body": "",
"status": 204,
"response": "",
Expand Down

0 comments on commit f70cecd

Please sign in to comment.