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

Should "exclude-paths" allow excluding specific files. #2266

Open
kinyoklion opened this issue Apr 10, 2024 · 0 comments
Open

Should "exclude-paths" allow excluding specific files. #2266

kinyoklion opened this issue Apr 10, 2024 · 0 comments
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@kinyoklion
Copy link
Contributor

  • What you're trying to do

I am converting a repository that uses release-please into a monorepo. This repository has a root package and I would not like for root configuration to version the package.

https://github.com/launchdarkly/go-server-sdk

{
  "separate-pull-requests": true,
  "include-component-in-tag" : true,
  "packages" : {
    "." : {
      "release-type" : "go",
      "bump-minor-pre-major" : true,
      "versioning" : "default",
      "include-component-in-tag" : false,
      "bootstrap-sha" : "25fcfa1ba34928c6dc6d1ee29f4504b7614fa55c",
      "extra-files" : [
        "internal/version.go"
      ],
      "exclude-paths": ["ldotel"]
    },
    "ldotel" : {
      "release-type" : "go",
      "tag-separator": "/",
      "versioning" : "default",
      "extra-files" : [
        "package_info.go"
      ]
    }
  }
}

What I would like to do is include things like "Makefile" in the "exclude-paths" for the root package.

  • What code you've already tried

I did try it, and it doesn't work. Paths here specifically effectively means directory.

The reason this doesn't work is because in commit-exclude.ts there is this function:

  private isRelevant(file: string, path: string) {
    return path === ROOT_PROJECT_PATH || file.indexOf(`${path}/`) === 0;
  }

It requires that path appear in the file's path with a /.

Something like:

  private isRelevant(file: string, path: string) {
    return path === ROOT_PROJECT_PATH || file.indexOf(`${path}/`) === 0 || file === path;
  }

Makes it function as expected and I can omit root files from a root package.

The question is, what is the desired behavior here? If it is to allow files, then I can make a PR for it. If not I will work around it by being careful to omit root files from releasable changes.

Thank you,
Ryan

@kinyoklion kinyoklion added priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue. labels Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

2 participants