Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Quote Command Is Broken #356

Closed
bgianfo opened this issue Feb 2, 2022 · 1 comment · Fixed by #527
Closed

Quote Command Is Broken #356

bgianfo opened this issue Feb 2, 2022 · 1 comment · Fixed by #527
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@bgianfo
Copy link
Member

bgianfo commented Feb 2, 2022

In summary, it looks like somehow commit 37f927c actually broke the bot more, than fixing anything.

@IdanHo Noticed that this is probably because of the implementation of valueToTreeObject in the octokit-plugin-create-pull-request package, where they check if it's a string, and if it isn't they give up parsing it and send the contents to the github blobs API instead.

https://github.com/gr2m/octokit-plugin-create-pull-request/blob/682ea7b47c16ce2b13bc07b09d201ea30381770b/src/value-to-tree-object.ts#L28

export async function valueToTreeObject(
  octokit: Octokit,
  owner: string,
  repo: string,
  path: string,
  value: string | File
) {
  let mode = "100644";
  if (value !== null && typeof value !== "string") {
    mode = value.mode || mode;
  }

  // Text files can be changed through the .content key
  if (typeof value === "string") {
    return {
      path,
      mode: mode,
      content: value,
    };
  }

  // Binary files need to be created first using the git blob API,
  // then changed by referencing in the .sha key
  const { data } = await octokit.request(
    "POST /repos/{owner}/{repo}/git/blobs",
    {
      owner,
      repo,
      ...value,
    }
  );
  const blobSha = data.sha;

  return {
    path,
    mode: mode,
    sha: blobSha,
  };
}

Link to the conversation on Discord

Chat Logs from discussing issue...
BertalanD — 01/17/2022
TIL /quote doesn't work anymore

Filmröllchen, Sampler of Audio — 01/17/2022
I'm honored nonetheless

IdanHo — 01/17/2022
it should :thonk:

Lubrsi — 01/17/2022
I think only mods can use it

IdanHo — 01/17/2022
When I originally added it I made it 100+ club

Filmröllchen, Sampler of Audio — 01/17/2022
I see an "application did not respond" message


IdanHo — 01/17/2022
Ah, that would probably just be a bug :caret: 

bgianf — 01/17/2022
I looked at the logs this was all that was in there: 
	2022-01-17T06:35:25.605612+00:00 app[worker.1]: Logged in as Buggie#5639.

	2022-01-17T07:09:03.602553+00:00 app[worker.1]: (node:54) DeprecationWarning: Passing strings for MessageEmbed#setAuthor is deprecated. Pass a sole object instead.

	2022-01-17T07:09:03.602561+00:00 app[worker.1]: (Use `node --trace-deprecation ...` to show where the warning was created)

	2022-01-17T14:53:53.636168+00:00 app[worker.1]: (node:54) DeprecationWarning: Passing strings for MessageEmbed#setFooter is deprecated. Pass a sole object instead.

doesn't seem related

IdanHo — 01/17/2022
Yeah it isn't

bgianf — 01/17/2022
I thought I had added tracing all the places where quote could fail
but... guess not

IdanHo — 01/17/2022
Yeah, there are a bunch of console.traces in the code
It's getting pretty late, so I'll try looking into it tomorrow

bgianf — 01/17/2022
Well that generated some logs

IdanHo — 01/17/2022
hmm, this API does exist though https://docs.github.com/en/rest/reference/git#blobs
@bgianf oh wait
that is trying to create the blob on the main repo
not on it's fork 🤔

bgianf — 01/17/2022
hrmm.. didn't it always work that way though?

IdanHo — 01/17/2022
I mean, how could it? the bot doesn't have access to the repo

bgianf — 01/17/2022
hrm... maybe it's like the GUI editor in the github web UI? where it does it transparently?

IdanHo — 01/17/2022
hmm possibly, there's also a different status code (403) for no access
404 is just for resource not found
as in, it thinks the repo doesn't exist
ooooh
the fortunes file was moved :)
no wait nvm, I'm just bad at writing cd commands 🤔
oh hmm
the library only uses that endpoint if it thinks the data were writing is binary and not text
which it obviously is not

bgianf — 01/17/2022
Maybe this caused more harm than good? 
commit 37f927cc0c266d41007be6494f0ee4faa4b351fb
Author: Brian Gianforcaro <bgianf@serenityos.org>
Date:   Thu Sep 2 16:44:46 2021 -0700

    Commands: Fix text encoding of the /quote command

    Because the quote command was encoding the fortunes.json file as
    binary when it received it from the API it was mangling the utf-8
    characters in the file when it it wrote it back when creating the
    pull request.

    Fix this by always using utf-8 encoding.
or maybe I didn't fix it all the way?

IdanHo — 01/17/2022
where's that commit?
I can't find it

bgianf — 01/17/2022
https://github.com/SerenityOS/discord-bot/commit/37f927cc0c266d41007be6494f0ee4faa4b351fb#diff-a81c635edbe9fc8c78e8ce1c8b66c9a22f7f6573c4ba2f85a3b122f49c02a483

IdanHo — 01/17/2022
I kept pulling from my fork instead of the main repo 🤦‍♂️

bgianf — 01/17/2022
maybe it is time for :sleepyak:

IdanHo — 01/17/2022
Yeah probably 😅
But yep, that change indeed triggers their condition
it just checks if it's a string, and if it isn't it gives up parsing it and sends it to the blobs api

bgianf — 01/17/2022
that code is in octokit-plugin-create-pull-request?
IdanHo — 01/17/2022
right
Logs from a failed quote invocation...
2022-01-17T23:16:19.388381+00:00 app[worker.1]: Trace: matchedCommand.handleContextMenu failed RequestError [HttpError]: Not Found

2022-01-17T23:16:19.388389+00:00 app[worker.1]:     at /app/node_modules/@octokit/request/dist-node/index.js:86:21

2022-01-17T23:16:19.388390+00:00 app[worker.1]:     at runMicrotasks (<anonymous>)

2022-01-17T23:16:19.388391+00:00 app[worker.1]:     at processTicksAndRejections (node:internal/process/task_queues:96:5)

2022-01-17T23:16:19.388392+00:00 app[worker.1]:     at async valueToTreeObject (/app/node_modules/octokit-plugin-create-pull-request/dist-node/index.js:74:7)

2022-01-17T23:16:19.388392+00:00 app[worker.1]:     at async Promise.all (index 0)

2022-01-17T23:16:19.388392+00:00 app[worker.1]:     at async createTree (/app/node_modules/octokit-plugin-create-pull-request/dist-node/index.js:95:17)

2022-01-17T23:16:19.388393+00:00 app[worker.1]:     at async composeCreatePullRequest (/app/node_modules/octokit-plugin-create-pull-request/dist-node/index.js:269:35)

2022-01-17T23:16:19.388394+00:00 app[worker.1]:     at async GithubAPI.openFortunesPullRequest (/app/build/apis/githubAPI.js:114:24)

2022-01-17T23:16:19.388394+00:00 app[worker.1]:     at async QuoteCommand.handleCommand (/app/build/commands/quoteCommand.js:75:35)

2022-01-17T23:16:19.388395+00:00 app[worker.1]:     at async CommandHandler.callInteractionHandler (/app/build/commandHandler.js:105:9) {

2022-01-17T23:16:19.388395+00:00 app[worker.1]:   status: 404,

2022-01-17T23:16:19.388396+00:00 app[worker.1]:   response: {

2022-01-17T23:16:19.388396+00:00 app[worker.1]:     url: 'https://api.github.com/repos/SerenityOS/serenity/git/blobs',

2022-01-17T23:16:19.388397+00:00 app[worker.1]:     status: 404,

2022-01-17T23:16:19.388397+00:00 app[worker.1]:     headers: {

2022-01-17T23:16:19.388397+00:00 app[worker.1]:       'access-control-allow-origin': '*',

2022-01-17T23:16:19.388399+00:00 app[worker.1]:       'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset',

2022-01-17T23:16:19.388399+00:00 app[worker.1]:       connection: 'close',

2022-01-17T23:16:19.388400+00:00 app[worker.1]:       'content-encoding': 'gzip',

2022-01-17T23:16:19.388400+00:00 app[worker.1]:       'content-security-policy': "default-src 'none'",

2022-01-17T23:16:19.388401+00:00 app[worker.1]:       'content-type': 'application/json; charset=utf-8',

2022-01-17T23:16:19.388401+00:00 app[worker.1]:       date: 'Mon, 17 Jan 2022 23:16:19 GMT',

2022-01-17T23:16:19.388402+00:00 app[worker.1]:       'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',

2022-01-17T23:16:19.388402+00:00 app[worker.1]:       server: 'GitHub.com',

2022-01-17T23:16:19.388402+00:00 app[worker.1]:       'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',

2022-01-17T23:16:19.388403+00:00 app[worker.1]:       'transfer-encoding': 'chunked',

2022-01-17T23:16:19.388403+00:00 app[worker.1]:       vary: 'Accept-Encoding, Accept, X-Requested-With',

2022-01-17T23:16:19.388403+00:00 app[worker.1]:       'x-accepted-oauth-scopes': '',

2022-01-17T23:16:19.388403+00:00 app[worker.1]:       'x-content-type-options': 'nosniff',

2022-01-17T23:16:19.388404+00:00 app[worker.1]:       'x-frame-options': 'deny',

2022-01-17T23:16:19.388404+00:00 app[worker.1]:       'x-github-media-type': 'github.v3; format=json',

2022-01-17T23:16:19.388405+00:00 app[worker.1]:       'x-github-request-id': 'C8F2:4605:54EB5C:E8BE43:61E5F8C3',

2022-01-17T23:16:19.388405+00:00 app[worker.1]:       'x-oauth-scopes': 'repo',

2022-01-17T23:16:19.388406+00:00 app[worker.1]:       'x-ratelimit-limit': '5000',

2022-01-17T23:16:19.388406+00:00 app[worker.1]:       'x-ratelimit-remaining': '4993',

2022-01-17T23:16:19.388406+00:00 app[worker.1]:       'x-ratelimit-reset': '1642464978',

2022-01-17T23:16:19.388406+00:00 app[worker.1]:       'x-ratelimit-resource': 'core',

2022-01-17T23:16:19.388407+00:00 app[worker.1]:       'x-ratelimit-used': '7',

2022-01-17T23:16:19.388407+00:00 app[worker.1]:       'x-xss-protection': '0'

2022-01-17T23:16:19.388407+00:00 app[worker.1]:     },

2022-01-17T23:16:19.388407+00:00 app[worker.1]:     data: {

2022-01-17T23:16:19.388407+00:00 app[worker.1]:       message: 'Not Found',

2022-01-17T23:16:19.388408+00:00 app[worker.1]:       documentation_url: 'https://docs.github.com/rest/reference/git#create-a-blob'

2022-01-17T23:16:19.388408+00:00 app[worker.1]:     }

2022-01-17T23:16:19.388408+00:00 app[worker.1]:   },

2022-01-17T23:16:19.388408+00:00 app[worker.1]:   request: {

2022-01-17T23:16:19.388409+00:00 app[worker.1]:     method: 'POST',

2022-01-17T23:16:19.388409+00:00 app[worker.1]:     url: 'https://api.github.com/repos/SerenityOS/serenity/git/blobs',

2022-01-17T23:16:19.388409+00:00 app[worker.1]:     headers: {

2022-01-17T23:16:19.388410+00:00 app[worker.1]:       accept: 'application/vnd.github.v3+json',

2022-01-17T23:16:19.388410+00:00 app[worker.1]:       'user-agent': 'BuggieBot octokit-rest.js/18.12.0 octokit-core.js/3.5.1 Node.js/17.3.1 (linux; x64)',

2022-01-17T23:16:19.388410+00:00 app[worker.1]:       authorization: 'token [REDACTED]',

2022-01-17T23:16:19.388411+00:00 app[worker.1]:       'content-type': 'application/json; charset=utf-8'

2022-01-17T23:16:19.388411+00:00 app[worker.1]:     },

2022-01-17T23:16:19.388438+00:00 app[worker.1]:     body: `{"content":"[\\n  {\\n    \\"quote\\": \\"add some quotes, problem solved?\\",\\n    \\"author\\": \\"linusg\\",\\n    \\"utc_time\\": 1596660175,\\n    \\"url\\": \\"https://freenode.logbot.info/serenityos/20200805#c4651652\\",\\n    \\"context\\": \\"About a different kind of quote, but that's good enough for me! :)\\"\\n  },\\n  {\\n    \\"quote\\": \\"BenW: i'm sure it's fine lol\\",\\n    \\"author\\": \\"kling\\",\\n    \\"utc_time\\": 1605364559,\\n    \\"url\\": \\"https://freenode.logbot.info/serenityos/20201114#c5825428\\"\\n  },\\n  {\\n    \\"quote\\": \\"dammit fuzzer, what madman would write '?~x/'?\\",\\n    \\"author\\": \\"CxByte\\",\\n    \\"utc_time\\": 1606653374,\\n    \\"url\\": \\"https://freenode.logbot.info/serenityos/20201129#c5999293\\",\\n    \\"context\\": \\"Fuzzers are even worse than users.\\"\\n  },\\n  {\\n    \\"quote\\": \\"I'd totally implement that\\",\\n    \\"author\\": \\"nooga\\",\\n    \\"utc_time\\": 1611335335,\\n    \\"url\\": \\"https://freenode.logbot.info/serenityos/20210122#c6624263\\"\\n  },\\n  {\\n    \\"quote\\": \\"No need to dereference the nullptr!\\",\\n    \\"author\\": \\"linusg\\",\\n    \\"utc_time\\": 1612014120,\\n    \\"url\\": \\"https://github.com/SerenityOS/serenity/commit/5b43419a636699d71752de7cec91f6eb35ed50b5\\"\\n  },\\n  {\\n    \\"quote\\": \\"We can't not have the quotes under VC, that's a sin\\",\\n    \\"author\\": \\"CxByte\\",\\n    \\"utc_time\\": 1612035713,\\n    \\"url\\": \\"https://freenode.logbot.info/serenityos/20210130#c6726388\\",\\n    \\"context\\": \\"A quote about putting quotes in VC, in VC.\\"\\n  },\\n  {\\n    \\"quote\\": \\"\\\\\\"We really should start a \\\\\\\\\\\\\\"Quotes\\\\\\\\\\\\\\" page.\\\\\\" - BenW\\",\\n    \\"author\\": \\"kling\\",\\n    \\"utc_time\\": 1612900961,\\n    \\"url\\": \\"https://freenode.logbot.info/serenityos/20210209#c6854420\\",\\n    \\"context\\": \\"Apparently I said that once too often.\\"\\n  },\\n  {\\n    \\"quote\\": \\"if your port uses textrels, it likely uses other things that we don't want near serenity\\",\\n    \\"author\\": \\"thakis\\",\\n    \\"utc_time\\": 1612900918,\\n    \\"url\\": \\"https://freenode.logbot.info/serenityos/20210209#c6854410\\",\\n    \\"context\\": \\"\\\\\\"jk but only a little bit jk\\\\\\"\\"\\n  },\\n  {\\n    \\"quote\\": \\"I'm afraid of where pulling that string will take me.\\",\\n    \\"author\\": \\"boricj\\",\\n    \\"utc_time\\": 1612954860,\\n    \\"url\\": \\"https://freenode.logbot.info/serenityos/20210210#c6866141\\",\\n    \\"context\\": \\"C++ templates will lead you down the rabbithole.\\"\\n  },\\n  {\\n    \\"quote\\": \\"$commitdescription ($user opened: The build failed.)\\",\\n    \\"author\\": \\"SerenityBot\\",\\n    \\"utc_time\\": 1613906220,\\n    \\"url\\": \\"https://freenode.logbot.info/serenityos/20210221#c6989891\\",\\n    \\"context\\": \\"The IRC notifications are a little bit harsh sometimes, especially if they all seem to spell failure.\\"\\n  },\\n  {\\n    \\"quote\\": \\"There cannot be more unused bits than the entirety of the input.\\",\\n    \\"author\\": \\"CxByte\\",\\n    \\"utc_time\\": 1615188240,\\n    \\"url\\": \\"https://github.com/SerenityOS/serenity/pull/5692#issue-586526857\\"\\n  },\\n  {\\n    \\"quote\\": \\"Does your code contain unexpected integer overflow? of course it does! contact BenW to find out why!\\",\\n    \\"author\\": \\"CxByte\\",\\n    \\"utc_time\\": 1615228585,\\n    \\"url\\": \\"https://freenode.logbot.info/serenityos/20210308#c7177736\\",\\n    \\"context\\": \\"Overflow-correct code is deviously hard. https://github.com/SerenityOS/serenity/commit/183b2e71ba8d85293db493cab27b8adb4af54981\\"\\n  },\\n  {\\n    \\"quote\\": \\"clang-format formatted your JSON file? Call Brian at bgianf@serenityos.org today! *Terms and conditions apply\\",\\n    \\"author\\": \\"Andrew Kaster\\",\\n    \\"utc_time\\": 1619133730,\\n    \\"url\\": \\"https://discord.com/channels/830522505605283862/830739873119207426/834932114125488149\\"\\n  },\\n  {\\n    \\"quote\\": \\"we started with dialup and \\\\\\"web 2.0\\\\\\" and ended up with touchscreen smartphones sucking broadband out of thin air\\",\\n    \\"author\\": \\"nooga\\",\\n    \\"url\\": \\"https://discord.com/channels/830522505605283862/830525235803586570/864277610510549002\\",\\n    \\"utc_time\\": 1626130562\\n  },\\n  {\\n    \\"quote\\": \\"1.28 GiB worth of hash table is a lot of hash table\\",\\n    \\"author\\": \\"awesomekling\\",\\n    \\"url\\": \\"https://discord.com/channels/830522505605283862/830739873119207426/870071227929202738\\",\\n    \\"utc_time\\": 1627511606\\n  },\\n  {\\n    \\"quote\\": \\"Changelog: All boogs fixed, thar be no moar boogs\\",\\n    \\"author\\": \\"CxByte\\",\\n    \\"utc_time\\": \\"1627859603\\",\\n    \\"url\\": \\"https://github.com/SerenityOS/serenity/pull/9127#issuecomment-890603297\\"\\n  },\\n  {\\n    \\"quote\\": \\"i'm here to influencer-marknadsföring and mjukvaruutveckling, and i'm all done utveckling the mjukvaru\\",\\n    \\"author\\": \\"thakis\\",\\n    \\"url\\": \\"https://discord.com/channels/830522505605283862/859531354219872266/877267999940292660\\",\\n    \\"utc_time\\": 1629242612\\n  },\\n  {\\n    \\"quote\\": \\"\\\\\\"Is there an ISO of Serenity?\\\\\\" – \\\\\\"No, because they charge money, and because it's not a spec.\\\\\\" – \\\\\\"… what?!\\\\\\"\\",\\n    \\"author\\": \\"BenW\\",\\n    \\"url\\": \\"https://discord.com/channels/830522505605283862/859531354219872266/889222244218327130\\",\\n    \\"utc_time\\": 1632077460\\n  },\\n  {\\n    \\"quote\\": \\"You reached the end of the internet, turn around\\",\\n    \\"author\\": \\"Hendiadyoin\\",\\n    \\"url\\": \\"https://discord.com/channels/830522505605283862/830525031720943627/876969458432884766\\",\\n    \\"utc_time\\": 1629156212,\\n    \\"context\\": \\"An interesting Browser bug. https://discord.com/channels/830522505605283862/830525031720943627/876966237077389352\\"\\n  },\\n  {\\n    \\"quote\\": \\"Widgets all inherit from Object, which has the methods for dealing with children\\",\\n    \\"author\\": \\"AtkinsSJ\\",\\n    \\"url\\": \\"https://discord.com/channels/830522505605283862/830529037251641374/882936925739171881\\",\\n    \\"utc_time\\": 1630578967\\n  },\\n  {\\n    \\"quote\\": \\"slaps roof of PR queue\\\\nThis baby can hold so many e̴̾̓l̷͑͑d̸̉̚r̵̅͂ï̷̀t̸͗̉c̵̾͝h̶̋͗ ̸̲̚h̸͒́ȱ̸r̶̛̄ȓ̶͌o̶͐͘r̴̲͝s̴̐͆\\",\\n    \\"author\\": \\"Andrew Kaster\\",\\n    \\"url\\": \\"https://discord.com/channels/830522505605283862/830525235803586570/922976701032562738\\",\\n    \\"utc_time\\": 1640125193\\n  },\\n  {\\n    \\"quote\\": \\"Do you like bugs? yeah, me neither, so I fixed one:\\",\\n    \\"author\\": \\"linusg\\",\\n    \\"url\\": \\"https://discord.com/channels/830522505605283862/859531354219872266/922965066423341066\\",\\n    \\"utc_time\\": 1640122419\\n  },\\n  {\\n    \\"quote\\": \\"why is german\\",\\n    \\"author\\": \\"Agni\\",\\n    \\"url\\": \\"https://discord.com/channels/830522505605283862/830525235803586570/917781310766993408\\",\\n    \\"utc_time\\": 1638886516\\n  },\\n  {\\n    \\"quote\\": \\"> Lasciate ogni speranza, voi ch'entrate!\\\\n> Abandon hope all ye who enter here\\\\n~ Dante\\",\\n    \\"author\\": \\"Hendiadyoin\\",\\n    \\"url\\": \\"https://discord.com/channels/830522505605283862/830522505605283866/917781369084596284\\",\\n    \\"utc_time\\": 1638886529,\\n    \\"context\\": \\"Multithreaded IPC. https://discord.com/channels/830522505605283862/830522505605283866/917780454298484806\\"\\n  },\\n  {\\n    \\"quote\\": \\"yakcoin is powered by proof of commits\\\\neverytime you shave a yak you earn one yakcoin\\",\\n    \\"author\\": \\"Agni\\",\\n    \\"url\\": \\"https://discord.com/channels/830522505605283862/830525235803586570/849632952089837599\\",\\n    \\"utc_time\\": 1622638681\\n  },\\n  {\\n    \\"quote\\": \\"tootlips\\",\\n    \\"author\\": \\"awesomekling\\",\\n    \\"url\\": \\"https://discord.com/channels/830522505605283862/830739873119207426/895421091856666685\\",\\n    \\"utc_time\\": 1633555424,\\n    \\"context\\": \\"https://discord.com/channels/830522505605283862/830739873119207426/895421023833436160\\"\\n  },\\n  {\\n    \\"quote\\": \\"and then the firebug nation attacked\\",\\n    \\"author\\": \\"gggggg\\",\\n    \\"url\\": \\"https://discord.com/channels/830522505605283862/830525031720943627/893862331312902166\\",\\n    \\"utc_time\\": 1633183786\\n  },\\n  {\\n    \\"quote\\": \\"those are some hefty meatballs\\",\\n    \\"author\\": \\"awesomekling\\",\\n    \\"url\\": \\"https://discord.com/channels/830522505605283862/830739873119207426/882756655018803311\\",\\n    \\"utc_time\\": 1630535987\\n  },\\n  {\\n    \\"quote\\": \\"not a shell boog this time\\",\\n    \\"author\\": \\"Agni\\",\\n    \\"url\\": \\"https://discord.com/channels/830522505605283862/859531354219872266/882660065474146304\\",\\n    \\"utc_time\\": 1630512958\\n  },\\n  {\\n    \\"quote\\": \\"Our Yak, thou art in the fields. Yakked be thy name (I'll stop now)\\",\\n    \\"author\\": \\"Filmröllchen, Sampler of Audio\\",\\n    \\"url\\": \\"https://discord.com/channels/830522505605283862/830525093905170492/932765051859927112\\",\\n    \\"utc_time\\": 1642461378\\n  }\\n]\\n","encoding":"utf-8"}`,

2022-01-17T23:16:19.388439+00:00 app[worker.1]:     request: { hook: [Function: bound bound register] }

2022-01-17T23:16:19.388439+00:00 app[worker.1]:   }

2022-01-17T23:16:19.388439+00:00 app[worker.1]: }

2022-01-17T23:16:19.388439+00:00 app[worker.1]:     at /app/build/commandHandler.js:106:21

2022-01-17T23:16:19.388440+00:00 app[worker.1]:     at runMicrotasks (<anonymous>)

2022-01-17T23:16:19.388440+00:00 app[worker.1]:     at processTicksAndRejections (node:internal/process/task_queues:96:5)

2022-01-17T23:16:19.388440+00:00 app[worker.1]:     at async CommandHandler.callInteractionHandler (/app/build/commandHandler.js:105:9)
@bgianfo bgianfo added the bug Something isn't working label Feb 2, 2022
bgianfo added a commit that referenced this issue Feb 2, 2022
This reverts commit 37f927c.

This was causing issues, as explained in issue #356.
@bgianfo bgianfo closed this as completed in 3338bb3 Feb 2, 2022
@bgianfo
Copy link
Member Author

bgianfo commented Feb 2, 2022

Sigh... there is still something wrong here, it works on my reproduction, but not in the bot. I guess it's something to do with the bots permission to the serenity fork?

2022-02-02T05:34:09.408380+00:00 app[worker.1]:     at /app/build/commandHandler.js:106:21
2022-02-02T05:34:09.408381+00:00 app[worker.1]:     at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-02-02T05:34:09.408381+00:00 app[worker.1]:     at async CommandHandler.callInteractionHandler (/app/build/commandHandler.js:105:9)
2022-02-02T05:37:05.839708+00:00 app[worker.1]: Trace: matchedCommand.handleContextMenu failed RequestError [HttpError]: Not Found
2022-02-02T05:37:05.839716+00:00 app[worker.1]:     at /app/node_modules/@octokit/request/dist-node/index.js:86:21
2022-02-02T05:37:05.839717+00:00 app[worker.1]:     at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-02-02T05:37:05.839718+00:00 app[worker.1]:     at async composeCreatePullRequest (/app/node_modules/octokit-plugin-create-pull-request/dist-node/index.js:289:3)
2022-02-02T05:37:05.839718+00:00 app[worker.1]:     at async GithubAPI.openFortunesPullRequest (/app/build/apis/githubAPI.js:114:24)
2022-02-02T05:37:05.839718+00:00 app[worker.1]:     at async QuoteCommand.handleCommand (/app/build/commands/quoteCommand.js:75:35)
2022-02-02T05:37:05.839719+00:00 app[worker.1]:     at async CommandHandler.callInteractionHandler (/app/build/commandHandler.js:105:9) {
2022-02-02T05:37:05.839720+00:00 app[worker.1]:   status: 404,
2022-02-02T05:37:05.839720+00:00 app[worker.1]:   response: {
2022-02-02T05:37:05.839721+00:00 app[worker.1]:     url: 'https://api.github.com/repos/BuggieBot/serenity/git/refs',
2022-02-02T05:37:05.839721+00:00 app[worker.1]:     status: 404,
2022-02-02T05:37:05.839722+00:00 app[worker.1]:     headers: {
2022-02-02T05:37:05.839722+00:00 app[worker.1]:       'access-control-allow-origin': '*',
2022-02-02T05:37:05.839724+00:00 app[worker.1]:       'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset',
2022-02-02T05:37:05.839724+00:00 app[worker.1]:       connection: 'close',
2022-02-02T05:37:05.839724+00:00 app[worker.1]:       'content-encoding': 'gzip',
2022-02-02T05:37:05.839725+00:00 app[worker.1]:       'content-security-policy': "default-src 'none'",
2022-02-02T05:37:05.839725+00:00 app[worker.1]:       'content-type': 'application/json; charset=utf-8',
2022-02-02T05:37:05.839726+00:00 app[worker.1]:       date: 'Wed, 02 Feb 2022 05:37:05 GMT',
2022-02-02T05:37:05.839726+00:00 app[worker.1]:       'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
2022-02-02T05:37:05.839727+00:00 app[worker.1]:       server: 'GitHub.com',
2022-02-02T05:37:05.839727+00:00 app[worker.1]:       'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
2022-02-02T05:37:05.839727+00:00 app[worker.1]:       'transfer-encoding': 'chunked',
2022-02-02T05:37:05.839728+00:00 app[worker.1]:       vary: 'Accept-Encoding, Accept, X-Requested-With',
2022-02-02T05:37:05.839728+00:00 app[worker.1]:       'x-accepted-oauth-scopes': 'repo',
2022-02-02T05:37:05.839728+00:00 app[worker.1]:       'x-content-type-options': 'nosniff',
2022-02-02T05:37:05.839729+00:00 app[worker.1]:       'x-frame-options': 'deny',
2022-02-02T05:37:05.839729+00:00 app[worker.1]:       'x-github-media-type': 'github.v3; format=json',
2022-02-02T05:37:05.839729+00:00 app[worker.1]:       'x-github-request-id': 'BF38:7AD8:3151F9:771F2C:61FA1881',
2022-02-02T05:37:05.839730+00:00 app[worker.1]:       'x-oauth-scopes': 'repo',
2022-02-02T05:37:05.839730+00:00 app[worker.1]:       'x-ratelimit-limit': '5000',
2022-02-02T05:37:05.839730+00:00 app[worker.1]:       'x-ratelimit-remaining': '4982',
2022-02-02T05:37:05.839731+00:00 app[worker.1]:       'x-ratelimit-reset': '1643783647',
2022-02-02T05:37:05.839731+00:00 app[worker.1]:       'x-ratelimit-resource': 'core',
2022-02-02T05:37:05.839731+00:00 app[worker.1]:       'x-ratelimit-used': '18',
2022-02-02T05:37:05.839731+00:00 app[worker.1]:       'x-xss-protection': '0'
2022-02-02T05:37:05.839732+00:00 app[worker.1]:     },
2022-02-02T05:37:05.839732+00:00 app[worker.1]:     data: {
2022-02-02T05:37:05.839732+00:00 app[worker.1]:       message: 'Not Found',
2022-02-02T05:37:05.839733+00:00 app[worker.1]:       documentation_url: 'https://docs.github.com/rest/reference/git#create-a-reference'
2022-02-02T05:37:05.839733+00:00 app[worker.1]:     }
2022-02-02T05:37:05.839733+00:00 app[worker.1]:   },
2022-02-02T05:37:05.839733+00:00 app[worker.1]:   request: {
2022-02-02T05:37:05.839734+00:00 app[worker.1]:     method: 'POST',
2022-02-02T05:37:05.839734+00:00 app[worker.1]:     url: 'https://api.github.com/repos/BuggieBot/serenity/git/refs',
2022-02-02T05:37:05.839734+00:00 app[worker.1]:     headers: {
2022-02-02T05:37:05.839735+00:00 app[worker.1]:       accept: 'application/vnd.github.v3+json',
2022-02-02T05:37:05.839736+00:00 app[worker.1]:       'user-agent': 'BuggieBot octokit-rest.js/18.12.0 octokit-core.js/3.5.1 Node.js/17.4.0 (linux; x64)',
2022-02-02T05:37:05.839736+00:00 app[worker.1]:       authorization: 'token [REDACTED]',
2022-02-02T05:37:05.839736+00:00 app[worker.1]:       'content-type': 'application/json; charset=utf-8'
2022-02-02T05:37:05.839736+00:00 app[worker.1]:     },
2022-02-02T05:37:05.839737+00:00 app[worker.1]:     body: '{"sha":"ee6a02e48f30452a2086192d05604667cf5fa73c","ref":"refs/heads/add-quote-1643780223"}',
2022-02-02T05:37:05.839737+00:00 app[worker.1]:     request: { hook: [Function: bound bound register] }
2022-02-02T05:37:05.839737+00:00 app[worker.1]:   }
2022-02-02T05:37:05.839738+00:00 app[worker.1]: }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant