Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Spelling #637

Merged
merged 12 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions HOW_IT_WORKS.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading
Loading