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

Debug information for config loading is not correct. #2152

Open
EvanCarroll opened this issue Sep 27, 2021 · 4 comments · May be fixed by #2155
Open

Debug information for config loading is not correct. #2152

EvanCarroll opened this issue Sep 27, 2021 · 4 comments · May be fixed by #2155

Comments

@EvanCarroll
Copy link

EvanCarroll commented Sep 27, 2021

When I run semantic-release, I see

  semantic-release:config load config from: /home/ecarroll/code/trash/foo/release.config.js +0ms
  semantic-release:config options values: {
  semantic-release:config   branches: [
  semantic-release:config     '+([0-9])?(.{+([0-9]),x}).x',
  semantic-release:config     'master',
  semantic-release:config     'next',
  semantic-release:config     'next-major',
  semantic-release:config     { name: 'beta', prerelease: true },
  semantic-release:config     { name: 'alpha', prerelease: true }
  semantic-release:config   ],
  semantic-release:config   repositoryUrl: 'file:///home/ecarroll/code/trash/foo',
  semantic-release:config   tagFormat: 'v${version}',
  semantic-release:config   plugins: [
  semantic-release:config     '@semantic-release/commit-analyzer',
  semantic-release:config     '@semantic-release/release-notes-generator',
  semantic-release:config     '@semantic-release/npm',
  semantic-release:config     '@semantic-release/github'
  semantic-release:config   ],
  semantic-release:config   _: [],
  semantic-release:config   n: true,
  semantic-release:config   debug: true,
  semantic-release:config   ci: true,
  semantic-release:config   '$0': 'semantic-release'
  semantic-release:config } +3ms

But actually what release.config.js has is this,

module.export = {
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    [
      "@google/semantic-release-replace-plugin",
      {
        "replacements": [{
          "files": ["app.config.json"],
          "from": "version: '.*'",
          "to": "version: '${nextRelease.version}'"
        }]
      }
    ],
    "@semantic-release/changelog",
    [
      "@semantic-release/git",
      {"assets": ["CHANGELOG.md", "app.config.json"]}
    ]
  ],
  "dryRun": true
}

It seems to be showing defaults, but that's not very intuitive. It's also not useful as it doesn't show the original contents at all.

@gr2m
Copy link
Member

gr2m commented Sep 27, 2021

It seems to be showing defaults, but that's not very intuitive

I don't agree, we have to set defaults, it makes sense to show these defaults. The config output shows the combination of this defaults with your config.

I agree there is room for improvements though, there always is :) What would the ideal output look like from your perspective? You are welcome to work on a pull request to improve it, it's not something we have the resources to do ourselves, but happy to accept a well crafted pull request

@EvanCarroll
Copy link
Author

EvanCarroll commented Sep 27, 2021

@gr2m It's not merging. It's just showing you a default .Put this in your releaserc.config.js,

module.export = {
	"branches": ["main"],
}

Now run this, semantic-release -n --debug --ci you don't even have to be in a git directory and you'll see.

  semantic-release:config options values: {
  semantic-release:config   branches: [
  semantic-release:config     '+([0-9])?(.{+([0-9]),x}).x',
  semantic-release:config     'master',
  semantic-release:config     'next',
  semantic-release:config     'next-major',
  semantic-release:config     { name: 'beta', prerelease: true },
  semantic-release:config     { name: 'alpha', prerelease: true }
  semantic-release:config   ],
  semantic-release:config   repositoryUrl: undefined,
  semantic-release:config   tagFormat: 'v${version}',
  semantic-release:config   plugins: [
  semantic-release:config     '@semantic-release/commit-analyzer',
  semantic-release:config     '@semantic-release/release-notes-generator',
  semantic-release:config     '@semantic-release/npm',
  semantic-release:config     '@semantic-release/github'
  semantic-release:config   ],
  semantic-release:config   _: [],
  semantic-release:config   n: true,
  semantic-release:config   debug: true,
  semantic-release:config   ci: true,
  semantic-release:config   '$0': 'semantic-release'
  semantic-release:config } +5ms```

But none of that "debug" information seems correct. The branches is not merged. Adding a package.json won't change anything either.

@gr2m
Copy link
Member

gr2m commented Sep 27, 2021

ahh I see it now, sorry! Yes, that definitely looks like a bug. Do you want to look into it?

@EvanCarroll
Copy link
Author

@gr2m patch up.

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