Skip to content

Commit

Permalink
fix: bump max number of files to 25 (all-contributors#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfix22 authored Nov 30, 2021
1 parent 30c1244 commit e214fae
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions lib/modules/content-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class ContentFiles {

async fetch(config) {
const options = config.get();
if (options.files.length > 15) {
if (options.files.length > 25) {
throw new AllContributorBotError(
`Your .all-contributorsrc cannot contain more than 15 files.`
`Your .all-contributorsrc cannot contain more than 25 files.`
);
}
this.contentFilesByPath = await this.repository.getMultipleFiles(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"name": ".all-contributorsrc",
"path": ".all-contributorsrc",
"sha": "dff34f715bca51114c0336a49381456a926806d5",
"size": 292,
"size": 464,
"url": "https://api.github.com/repos/all-contributors/all-contributors-bot/contents/.all-contributorsrc?ref=master",
"html_url": "https://github.com/all-contributors/all-contributors-bot/blob/master/.all-contributorsrc",
"git_url": "https://api.github.com/repos/all-contributors/all-contributors-bot/git/blobs/dff34f715bca51114c0336a49381456a926806d5",
"download_url": "https://raw.githubusercontent.com/all-contributors/all-contributors-bot/master/.all-contributorsrc",
"type": "file",
"content": "ewogICJmaWxlcyI6IFsKICAgICIxLm1kIiwKICAgICIyLm1kIiwKICAgICIzLm1kIiwKICAgICI0Lm1kIiwKICAgICI1Lm1kIiwKICAgICI2Lm1kIiwKICAgICI3Lm1kIiwKICAgICI4Lm1kIiwKICAgICI5Lm1kIiwKICAgICIxMC5tZCIsCiAgICAiMTEubWQiLAogICAgIjEyLm1kIiwKICAgICIxMy5tZCIsCiAgICAiMTQubWQiLAogICAgIjE1Lm1kIiwKICAgICIxNi5tZCIKICBdCn0=",
"content": "ewogICJmaWxlcyI6IFsKICAgICIxLm1kIiwKICAgICIyLm1kIiwKICAgICIzLm1kIiwKICAgICI0Lm1kIiwKICAgICI1Lm1kIiwKICAgICI2Lm1kIiwKICAgICI3Lm1kIiwKICAgICI4Lm1kIiwKICAgICI5Lm1kIiwKICAgICIxMC5tZCIsCiAgICAiMTEubWQiLAogICAgIjEyLm1kIiwKICAgICIxMy5tZCIsCiAgICAiMTQubWQiLAogICAgIjE1Lm1kIiwKICAgICIxNi5tZCIsCiAgICAiMTcubWQiLAogICAgIjE4Lm1kIiwKICAgICIxOS5tZCIsCiAgICAiMjAubWQiLAogICAgIjIxLm1kIiwKICAgICIyMi5tZCIsCiAgICAiMjMubWQiLAogICAgIjI0Lm1kIiwKICAgICIyNS5tZCIsCiAgICAiMjYubWQiCiAgXQp9",
"encoding": "base64",
"_links": {
"self": "https://api.github.com/repos/all-contributors/all-contributors-bot/contents/.all-contributorsrc?ref=master",
Expand Down
8 changes: 4 additions & 4 deletions test/integration/__snapshots__/issue_comment.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`issue_comment event .all-contributorsrc has 16 files: logs 1`] = `
exports[`issue_comment event .all-contributorsrc has 26 files: logs 1`] = `
Array [
Object {
"error": "AllContributorBotError",
"id": "1",
"isKnownError": true,
"level": 30,
"msg": "Your .all-contributorsrc cannot contain more than 15 files.",
"msg": "Your .all-contributorsrc cannot contain more than 25 files.",
"name": "event",
},
]
`;

exports[`issue_comment event .all-contributorsrc has 16 files: request body 1`] = `
exports[`issue_comment event .all-contributorsrc has 26 files: request body 1`] = `
Object {
"body": "@jakebolam
Your .all-contributorsrc cannot contain more than 15 files.",
Your .all-contributorsrc cannot contain more than 25 files.",
}
`;

Expand Down
48 changes: 24 additions & 24 deletions test/integration/issue_comment.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const issueCommentCreatedNotForAppPayload = require("../fixtures/issue_comment.c
const issueCommentCreatedPayloadUnknownIntention = require("../fixtures/issue_commented.created.unknown-intention.json");
const issueCommentCreatedPayloadUnknownContribution = require("../fixtures/issue_comment.created-unknown-contribution.json");
const reposGetContentsAllContributorsRCdata = require("../fixtures/repos.getContents.all-contributorsrc.json");
const reposGetContentsAllContributorsRCdata16files = require("../fixtures/repos.getContents.all-contributorsrc-16-files.json");
const reposGetContentsAllContributorsRCdata26files = require("../fixtures/repos.getContents.all-contributorsrc-26-files.json");
const reposGetContentsAllContributorsRCdataSkipCiFalse = require("../fixtures/repos.getContents.all-contributorsrc-skip-ci-false.json");
const reposGetContentsAllContributorsRCdataInvalidSyntax = require("../fixtures/repos.getContents.all-contributorsrc-invalid-syntax.json");
const usersGetByUsernameJakeBolamdata = require("../fixtures/users.getByUsername.jakebolam.json");
Expand Down Expand Up @@ -480,27 +480,27 @@ describe("issue_comment event", () => {

test("Fail path, add existing contributor with already exist contribution type", async () => {
const mock = nock("https://api.github.com")
.get(
`/repos/all-contributors/all-contributors-bot/git/ref/heads%2Fall-contributors%2Fadd-jakebolam`
)
.reply(404)

.get(
"/repos/all-contributors/all-contributors-bot/contents/.all-contributorsrc?ref=master"
)
.reply(200, reposGetContentsAllContributorsRCdata)

.get("/users/jakebolam")
.reply(200, usersGetByUsernameJakeBolamdata)

.post(
"/repos/all-contributors/all-contributors-bot/issues/1/comments",
(body) => {
expect(body).toMatchSnapshot("request body");
return true;
}
)
.reply(200);
.get(
`/repos/all-contributors/all-contributors-bot/git/ref/heads%2Fall-contributors%2Fadd-jakebolam`
)
.reply(404)

.get(
"/repos/all-contributors/all-contributors-bot/contents/.all-contributorsrc?ref=master"
)
.reply(200, reposGetContentsAllContributorsRCdata)

.get("/users/jakebolam")
.reply(200, usersGetByUsernameJakeBolamdata)

.post(
"/repos/all-contributors/all-contributors-bot/issues/1/comments",
(body) => {
expect(body).toMatchSnapshot("request body");
return true;
}
)
.reply(200);

await probot.receive({
name: "issue_comment",
Expand All @@ -512,7 +512,7 @@ describe("issue_comment event", () => {
expect(output).toMatchSnapshot("logs");
});

test(".all-contributorsrc has 16 files", async () => {
test(".all-contributorsrc has 26 files", async () => {
const mock = nock("https://api.github.com")
.get(
`/repos/all-contributors/all-contributors-bot/git/ref/heads%2Fall-contributors%2Fadd-jakebolam`
Expand All @@ -525,7 +525,7 @@ describe("issue_comment event", () => {
.get(
"/repos/all-contributors/all-contributors-bot/contents/.all-contributorsrc?ref=master"
)
.reply(200, reposGetContentsAllContributorsRCdata16files)
.reply(200, reposGetContentsAllContributorsRCdata26files)

.post(
"/repos/all-contributors/all-contributors-bot/issues/1/comments",
Expand Down

0 comments on commit e214fae

Please sign in to comment.