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

The log level isn't adjustable and every hook reaction is returning POST 404 #1987

Closed
FuroremVulpes opened this issue Mar 12, 2024 · 3 comments

Comments

@FuroremVulpes
Copy link

Bug Report

Current Behavior
After the probot module update to any of 13.0+ versions the log level is 30 and isn't changing no matter what LOG_LEVEL is set as env. In addition to that, every reaction on hooks is generating a POST on / with no payload which gets 404. No changes in code is done, except of probot version. The POST call isn't the one we are making as a reaction on the hook. Logs do not contain ANY info or debug logs we have in code. Setting it back to 12.3.3 make everything work.

Expected behavior/code
On lower versions (without any changes in the code) the probot reacts on hooks as it's set in the code and setting log level works as expected.

Environment

  • Probot version(s): v13.0.0 (every beta and higher)
  • Node/npm version: Node v21.7.1
Copy link

welcome bot commented Mar 12, 2024

Thanks for opening this issue. A contributor should be by to give feedback soon. In the meantime, please check out the contributing guidelines and explore other ways you can get involved.

@wolfy1339
Copy link
Collaborator

wolfy1339 commented Mar 12, 2024

Can you please provide code examples?

Have you changed your code for the breaking changes of v13?

https://github.com/probot/probot/releases/tag/v13.0.0

GitHub
13.0.0 (2024-01-25) Features

v13 (#1874) (948a1b7), closes #1643
Upgrade Octokit libraries to their latest major version

BREAKING CHANGES

Drop support for NodeJS < 18
replace node-fetch with the...

@FuroremVulpes
Copy link
Author

FuroremVulpes commented Mar 13, 2024

Sure. We don't use the parts mentioned in the breaking changes. As for the Node version, we're using v21 (as well, no changes had to be done in regards of breaking changes). Part of the code we have:

/**
 * @param {import('probot').Probot} robot
 */
module.exports = (robot, _, Settings = require('./lib/settings'), mutexes = new Map()) => {
  async function syncSettings(context, repo = context.repo(), settings = {}) {
    repo.mutexes = mutexes
    const config = await context.config('settings.yml', settings, {arrayMerge: mergeArrayByName})
    robot.log.debug(`config changes: '${JSON.stringify(config)}'`)
    return Settings.sync(context.octokit, repo, config, context.payload.after)
  }
  robot.on('repository.edited', async context => {
    const {payload} = context
    const {changes, repository} = payload
    robot.log.debug('Reaction on the repository.edited webhook...')
    if (!Object.prototype.hasOwnProperty.call(changes, 'default_branch')) {
      robot.log.debug('Repository configuration was edited but the default branch was not affected, returning...')
      return
    }
   robot.log.debug(`Default branch changed from '${changes.default_branch.from}' to '${repository.default_branch}'`)
    return syncSettings(context)
  })
  }

Those debug messages aren't in the logs when we run this code on the v13.0 and higher (minding that log level is set to debug in both versions builds).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants