googleapis / release-please

generate release PRs based on the conventionalcommits.org spec
https://www.conventionalcommits.org
Apache License 2.0
4.9k stars 369 forks source link

Manifest release configuration not compatible with Monorepo that is a node project with a rust workspace #2207

Open nrodriguez-chub opened 9 months ago

nrodriguez-chub commented 9 months ago

1) Is this a client library issue or a product issue? Client library

2) Did someone already solve this? Nope

3) Do you have a support contract? Nope

If the support paths suggested above still do not result in a resolution, please provide the following details.

Environment details

Steps to reproduce

  1. Create a Serverless project with a Rust workspace. Given how serverless works, it is established as a Node project, that acts as a wrapper for the Rust workspace. Ideally, what I want to achieve is that no matter the file that is modified in the repo, all components should bump their release to the same next value. Currently, I was able to achieve the following:
    • if any file on the rust packages is touched, version is bumped on all the rust modules
    • if any file is touched outside the rust packages, version is bumped only on the node project

I use a manifest release, combined with the plugins rust-workspace and linked-versions, as stated in the docs. Is there a way to tell release-please that the root project should be treated the same way as the others? thanks.

Example structure of the project (simplified):

.
├── README.md
├── serverless.yml
├── .release-please-manifest.json
├── node_modules
├── package-lock.json
├── package.json
├── release-please-config.json
├── Cargo.lock
├── Cargo.toml
├── bots
 │  ├── pck-a
 │   │   ├── Cargo.toml
 │   │   ├── serverless.yml
 │   │   └── src
 │  ├── pck-b
 │   │   ├── Cargo.toml
 │   │   ├── serverless.yml
 │   │   └── src

release-please-config.json file:

{
    "include-component-in-tag": false,
    "packages": {
        ".": {
            "release-type": "node",
            "component": "root"
        },
        "bots/pck-a": {
            "release-type": "rust",
            "component": "pck_a"
        },
        "bots/pck-b": {
            "release-type": "rust",
            "component": "pck_b"
        },
    },
    "plugins": [
        {
            "type": "cargo-workspace",
            "merge": false
        },
        {
            "type": "linked-versions",
            "groupName": "group-all",
            "components": [
                "root",
                "pck_a",
                "pck_b"
            ]
        }
    ]
}

The file .release-please-manifest.json content looks like this: { ".": "2.2.0", "bots/pck-a": "2.2.0", "bots/pck-b": "2.2.0" }

Update:

I would be ok with not upgrading the node package.json version, I don't actually need that, but what I DO need is that whenever any file in the project has a change, all the rust packages bump their version. I tried using extra-files for this, but failed miserably :D

nrodriguez-chub commented 9 months ago

Well, did more research, and realised that this config will never work with the current codebase, given having include-component-in-tag=false and using linked-versions plugin configured has an open PR: https://github.com/googleapis/release-please/pull/1749 Merging that PR should fix my case.

nrodriguez-chub commented 9 months ago

I created a new fork and corresponding PR to solve the issue, here: https://github.com/googleapis/release-please/pull/2208 I had to do it as the PR was too outdated with main branch

nrodriguez-chub commented 9 months ago

Given I created the fork with the company I work for user, I preferred to close it and create a new one with my personal account, so the acceptance of google policy is way easier and faster: https://github.com/googleapis/release-please/pull/2211