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

--includes CLI option and GH action input not being respected #402

Open
bmaximuml opened this issue Jan 24, 2024 · 0 comments
Open

--includes CLI option and GH action input not being respected #402

bmaximuml opened this issue Jan 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@bmaximuml
Copy link
Contributor

Describe the bug
When passing --includes on the command line, or through the Github Action input, the value given to it is ignored. It is respected when specified in the package.json file.

To Reproduce
Using cli arg (doesn't work)
DEBUG=* npx [email protected] generate --includes '["**/.codeowners"]'

  agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::] create, timeout 300001ms +0ms
  agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::](requests: 1, finished: 1) free +51ms
💫 No custom configuration found
⠋ generating codeowners...  codeowners-generator:generate Options: {
  includes: [],
  output: 'CODEOWNERS',
  useMaintainers: false,
  useRootMaintainers: false,
  groupSourceComments: false,
  preserveBlockPosition: false,
  customRegenerationCommand: undefined
} +0ms
  codeowners-generator:generate input: /Users/maxlevine/.npm/_npx/d833e66f16380070/node_modules/codeowners-generator/dist [] false false +1ms
  codeowners-generator:generate includePatterns: [
  '**/CODEOWNERS',
  '!CODEOWNERS',
  '!.github/CODEOWNERS',
  '!docs/CODEOWNERS',
  '!node_modules'
] +0ms
  codeowners-generator:generate provided globs: [
  '**/CODEOWNERS',
  '!CODEOWNERS',
  '!.github/CODEOWNERS',
  '!docs/CODEOWNERS',
  '!node_modules'
] +0ms
  codeowners-generator:generate files found: [
  'some_dir/CODEOWNERS',
  'some_other_dir/CODEOWNERS',
] +264ms
  codeowners-generator:parseIgnoreFiles found [ '/Users/maxlevine/Repos/my_repo/.gitignore' ] +0ms
  codeowners-generator:readFile reading... /Users/maxlevine/Repos/my_repo/.gitignore +0ms
⠙ generating codeowners...  codeowners-generator:parseIgnoreFiles ignore patterns found: [
  '**secret**',
  '**/crash.log',
  '**__pycache__**'
] +2ms
  codeowners-generator:generate matches after filtering ignore patterns: [
  'some_dir/CODEOWNERS',
  'some_other_dir/CODEOWNERS',
] +5ms
  codeowners-generator:readFile reading... some_dir/CODEOWNERS +3ms
  codeowners-generator:readFile reading... some_other_dir/CODEOWNERS +0ms
  codeowners-generator:utils/codeowners output file CODEOWNERS exists, extracting content before overwriting +0ms
  codeowners-generator:readFile reading... CODEOWNERS +4ms
💫 CODEOWNERS file was created! location: CODEOWNERS

With the following package.json (does work)

{
  "name": "my_repo",
  "codeowners-generator": {
    "includes": ["**/.codeowners"],
    "output": ".github/CODEOWNERS",
    "groupSourceComments": true
  }
}

$ DEBUG=* npx [email protected] generate

  agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::] create, timeout 300001ms +0ms
  agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::](requests: 1, finished: 1) free +1s
💫 Custom configuration found in /Users/maxlevine/Repos/my_repo/package.json
  codeowners-generator:customConfiguration custom configuration found: {
  config: { includes: [ '**/.codeowners' ] },
  filepath: '/Users/maxlevine/Repos/my_repo/package.json'
} +0ms
⠋ generating codeowners...  codeowners-generator:generate Options: {
  includes: [ '**/.codeowners' ],
  output: 'CODEOWNERS',
  useMaintainers: false,
  useRootMaintainers: false,
  groupSourceComments: false,
  preserveBlockPosition: false,
  customRegenerationCommand: undefined
} +0ms
  codeowners-generator:generate input: /Users/maxlevine/.npm/_npx/d833e66f16380070/node_modules/codeowners-generator/dist [ '**/.codeowners' ] false false +0ms
  codeowners-generator:generate includePatterns: [ '**/.codeowners' ] +0ms
  codeowners-generator:generate provided globs: [ '**/.codeowners' ] +0ms
  codeowners-generator:generate files found: [ 'devops-160418/.codeowners', 'some_dir/.codeowners' ] +270ms
  codeowners-generator:parseIgnoreFiles found [ '/Users/maxlevine/Repos/my_repo/.gitignore' ] +0ms
  codeowners-generator:readFile reading... /Users/maxlevine/Repos/my_repo/.gitignore +0ms
⠙ generating codeowners...  codeowners-generator:parseIgnoreFiles ignore patterns found: [
  '**secret**',
  '**/crash.log',
  '**__pycache__**'
] +2ms
  codeowners-generator:generate matches after filtering ignore patterns: [ 'some_other_dir/.codeowners', 'some_dir.codeowners' ] +5ms
  codeowners-generator:readFile reading... some_other_dir/.codeowners +4ms
  codeowners-generator:readFile reading... some_dir/.codeowners +0ms
  codeowners-generator:utils/codeowners output file CODEOWNERS exists, extracting content before overwriting +0ms
  codeowners-generator:readFile reading... CODEOWNERS +2ms
💫 CODEOWNERS file was created! location: CODEOWNERS

Expected behavior
--includes should work consistently as documented

@bmaximuml bmaximuml added the bug Something isn't working label Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant