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

Option "include-component-in-tag" is ignored #951

Open
Sebastian-0 opened this issue Mar 8, 2024 · 9 comments
Open

Option "include-component-in-tag" is ignored #951

Sebastian-0 opened this issue Mar 8, 2024 · 9 comments

Comments

@Sebastian-0
Copy link

Sebastian-0 commented Mar 8, 2024

TL;DR

Setting the option include-component-in-tag: true has no effect, no matter whether you set it in the workflow file or the manifest file.

Expected behavior

When setting the option include-component-in-tag: true the tags should be generated with a component name, like comp_v1.0.

Observed behavior

No matter where I set the option I still only get tags like v1.0, no component name is prepended. I'm not 100% sure where the component name is supposed to come from actually since there is no setting to define one, so maybe I'm missing some detail to get this working.

Action YAML

name: Workflow name
run-name: "${{github.workflow}}: ${{github.event.head_commit.message}}"
concurrency: build-${{github.ref}}

on:
  workflow_dispatch:
  push:
    branches-ignore:
      - 'stable'

jobs:
  release:
    name: Do release
    runs-on: self-hosted
    steps:
      - name: Release
        uses: google-github-actions/release-please-action@v4
        with:
          token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
          config-file: release-please-config.json
          manifest-file: .release-please-manifest.json
          target-branch: dev-release
          include-component-in-tag: true  # <--- No effect

Log output

Run google-github-actions/release-please-action@v4
Running release-please version: 16.5.0
❯ Fetching release-please-config.json from branch dev-release
❯ Fetching .release-please-manifest.json from branch dev-release
✔ Building releases
✔ Building strategies by path
❯ .: simple
❯ src/blocks/gfx: simple
❯ Fetching release-please-config.json from branch dev-release
❯ Fetching .release-please-manifest.json from branch dev-release
✔ Building pull requests
✔ Building strategies by path
❯ .: simple
❯ src/blocks/gfx: simple
⚠ Multiple paths for : ., src/blocks/gfx
✔ Collecting release commit SHAs
❯ release search depth: 400
❯ Fetching releases with cursor undefined
❯ Found release for path src/blocks/gfx, v1.8.0
⚠ Expected 2 releases, only found 1
⚠ Missing 1 paths: .
❯ looking for tagName: v1.4.0
❯ found: v1.4.0 47743b360e9814b2cff46014e5bf32a1bf5b5575
❯ release for path: src/blocks/gfx, version: 1.8.0, sha: 4decc9d05250e2f4e62488b28f2191cb2f8f3720
❯ release for path: ., version: 1.4.0, sha: 47743b360e9814b2cff46014e5bf32a1bf5b5575
✔ Collecting commits since all latest releases
❯ commit search depth: 500
❯ Set(2) {
  '4decc9d05250e2f4e62488b28f2191cb2f8f3720',
  '47743b360e9814b2cff46014e5bf32a1bf5b5575'
}
❯ Fetching merge commits on branch dev-release with cursor: undefined
❯ Backfilling file list for commit: 69eec52ac5d6a9d3264d3070249ad3e49b6f0ee1
❯ Found 1 files
❯ Backfilling file list for commit: 4decc9d05250e2f4e62488b28f2191cb2f8f3720
❯ Found 2 files
❯ Backfilling file list for commit: 390442391e28051085e5b3e63af6b8038112088d
❯ Found 2 files
❯ Backfilling file list for commit: fcf0d3bace5d282c9cb267ce68691d5b6cc8fb2a
❯ Found 2 files
❯ Backfilling file list for commit: cb14e805a25dc4f9508a56092ae8d048fca52472
❯ Found 1 files
❯ Backfilling file list for commit: f58d7b2bedacd0414451b1900d195f73ef5d13f1
❯ Found 1 files
❯ Backfilling file list for commit: fb2c9176892af696dbe17d5f493f076873bfc4f5
❯ Found 2 files
❯ Backfilling file list for commit: 65cdcfe548128ca325226629c0683a90616cbe91
❯ Found 2 files
❯ Backfilling file list for commit: 874a4e8d709cb5d7f3cd7d7a4d1a748c86cbbdc0
❯ Found 1 files
❯ Backfilling file list for commit: 27529828d45790598e76b085029ea6a50b82cf6d
❯ Found 2 files
❯ Backfilling file list for commit: 4a943dd823c29ab0c28015f7241a92a7472e1a6e
❯ Found 2 files
❯ Backfilling file list for commit: dda72f7beb9e14857c47570689ed0e25a50df56c
❯ Found 1 files
❯ Backfilling file list for commit: 2b4a84a4b783b9ff9bb30f0f4d0567d5bc1e752e
❯ Found 1 files
❯ Backfilling file list for commit: 8f1052e9506e9ff024ebebd46f85a3abc034d5f3
❯ Found 2 files
❯ Backfilling file list for commit: 24d18c6e97941648653e0e2acd434c1da8c727c2
❯ Found 2 files
❯ Backfilling file list for commit: 946e4017cafd9f1522236ed43cda23036165d7eb
❯ Found 1 files
❯ Backfilling file list for commit: 7ef52de046a186ba891f6691715956bbb0462ced
❯ Found 2 files
❯ Backfilling file list for commit: 2686084c2b68974353610202ca0ae5148479bc1c
❯ Found 2 files
❯ Backfilling file list for commit: 8a7628f8fb6e9a3db51e01aed1c5e0bb4a5d5686
❯ Found 1 files
❯ Backfilling file list for commit: 47743b360e9814b2cff46014e5bf32a1bf5b5575
❯ Found 3 files
❯ Backfilling file list for commit: 5e393b3eb5577d7bafd6cc51d881e242fb766568
❯ Found 3 files
❯ Backfilling file list for commit: ff9b9c4ba8d8ca4cf0deb16d5d2ca18372be6f69
❯ Found 1 files
❯ Backfilling file list for commit: f9a7bf9adbfd3b238cf2ce973a8516bf7a442d54
❯ Found 1 files
❯ Backfilling file list for commit: 9f6eb033c4c7ac74504b00d74b2b1e78ee2f2992
❯ Found 1 files
❯ Backfilling file list for commit: 48010c1b0ee2d199ae4f0aabea7e621c12b17eb5
❯ Found 3 files
✔ Splitting 19 commits by path
✔ Building candidate release pull request for path: .
❯ type: simple
❯ targetBranch: dev-release
❯ commit could not be parsed: 4decc9d05250e2f4e62488b28f2191cb2f8f3720 Merge pull request #26 from ***/release-please--branches--dev-release
❯ commit could not be parsed: fcf0d3bace5d282c9cb267ce68691d5b6cc8fb2a Revert downgrade
❯ commit could not be parsed: f58d7b2bedacd0414451b1900d195f73ef5d13f1 Downgrade release please
❯ commit could not be parsed: fb2c9176892af696dbe17d5f493f076873bfc4f5 Merge pull request #25 from ***/release-please--branches--dev-release
❯ commit could not be parsed: 27529828d45790598e76b085029ea6a50b82cf6d Merge pull request #24 from ***/release-please--branches--dev-release
❯ commit could not be parsed: 8f1052e9506e9ff024ebebd46f85a3abc034d5f3 Merge pull request #23 from ***/release-please--branches--dev-release
❯ commit could not be parsed: 946e4017cafd9f1522236ed43cda23036165d7eb Include component in tag
❯ commit could not be parsed: 7ef52de046a186ba891f6691715956bbb0462ced Merge pull request #22 from ***/release-please--branches--dev-release
❯ commits: 5
✔ Considering: 5 commits
❯ component: 
❯ pull request title pattern: undefined
✔ No user facing commits found since 47743b360e9814b2cff46014e5bf32a1bf5b5575 - skipping
✔ Building candidate release pull request for path: src/blocks/gfx
❯ type: simple
❯ targetBranch: dev-release
❯ commits: 1
✔ Considering: 1 commits
❯ component: 
❯ pull request title pattern: undefined
❯ running plugin: Merge
✔ Merging 1 pull requests
⚠ pullRequestTitlePattern miss the part of '${scope}'
⚠ pullRequestTitlePattern miss the part of '${component}'
⚠ pullRequestTitlePattern miss the part of '${version}'
✔ Looking for open release pull requests
✔ found 0 open release pull requests.
✔ Looking for snoozed release pull requests
✔ found 0 snoozed release pull requests.
❯ Fetching src/blocks/gfx/CHANGELOG.md from branch dev-release
❯ Fetching src/blocks/gfx/version.txt from branch dev-release
❯ Fetching .release-please-manifest.json from branch dev-release
⚠ file src/blocks/gfx/version.txt did not exist
✔ Starting GitHub PR workflow...
✔ Successfully found branch HEAD sha "69eec52ac5d6a9d3264d3070249ad3e49b6f0ee1".
✔ Skipping branch creation step...
✔ Got the latest commit tree
✔ Successfully created a tree with the desired changes with SHA f87bffc6cd9c42297f9a9b0f73173bb3c2291ab6
✔ Successfully created commit. See commit at https://api.github.com/repos/***/git/commits/066c1f3424207319cae33860c89435b41eca60f1
✔ Updating reference heads/release-please--branches--dev-release to 066c1f3424207319cae33860c89435b41eca60f1
✔ Successfully updated reference release-please--branches--dev-release to 066c1f3424207319cae33860c89435b41eca60f1
✔ Successfully opened pull request available at url: https://api.github.com/repos/***/pulls/27.
✔ Successfully opened pull request: 27.
✔ Successfully added labels autorelease: pending to issue: 27

Additional information

Manifest file release-please-config.json, here I also added include-component-in-tag: true but to no effect:

{
    "include-component-in-tag": true,
    "packages": {
        ".": {
            "changelog-path": "CHANGELOG.md",
            "release-type": "simple",
            "bump-minor-pre-major": false,
            "bump-patch-for-minor-pre-major": false,
            "draft": false,
            "prerelease": false,
            "exclude-paths": ["src/blocks/gfx"],
            "include-component-in-tag": true
        },
        "src/blocks/gfx": {
            "changelog-path": "CHANGELOG.md",
            "release-type": "simple",
            "bump-minor-pre-major": false,
            "bump-patch-for-minor-pre-major": false,
            "draft": false,
            "prerelease": false,
            "include-component-in-tag": true
        }
    },
    "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}
@Sebastian-0 Sebastian-0 added the bug label Mar 8, 2024
@coderkakarrot
Copy link

I was trying out release please to manage releases inside the monorepo. I am facing the same issue.
content of release-please-config.json

{
  "packages": {
    ".": {
      "changelog-path": "CHANGELOG.md",
      "bump-minor-pre-major": false,
      "bump-patch-for-minor-pre-major": false,
      "draft": false,
      "prerelease": false,
      "exclude-paths": ["cache", "metrics"],
      "include-v-in-tag": true,
      "extra-labels": ["main"],
      "release-type": "simple"
    },
    "cache": {
      "release-type": "go",
      "include-v-in-tag": true,
      "include-component-in-tag": true,
      "extra-labels": ["cache"],
      "tag-separator": "@"
    },
    "metrics": {
      "release-type": "go",
      "include-v-in-tag": true,
      "include-component-in-tag": true,
      "extra-labels": ["metrics"]
    }
  },
  "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}

github action workflow content

on:
  push:
    branches:
      - main

permissions:
  contents: write
  pull-requests: write

name: release-please

jobs:
  release-please:
    runs-on: ubuntu-latest
    steps:
      - uses: google-github-actions/release-please-action@v4
        with:
          # this assumes that you have created a personal access token
          # (PAT) and configured it as a GitHub action secret named
          # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
          token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
          config-file: release-please-config.json
          manifest-file: .release-please-manifest.json
          include-component-in-tag: true

@Sebastian-0
Copy link
Author

Sebastian-0 commented Mar 13, 2024

It turned out the issue in my case was that release-type: simple does not have component names defined for your manifest's packages, it only has a version (in version.txt). In my case I wanted to use node as the release type anyway, and when I added a package.json with a name property for each package it started working. I also stopped using the global package . and instead moved everything into sub-folders (no idea if this helped fix the issue since I did this before the other change).

This behaviour is not documented. I'm not sure if you're facing a similar issue @coderkakarrot , maybe your packages are lacking a name property?

@shoootyou
Copy link

@Sebastian-0 Can you share your folder structure and final configuration final to check? I have the same issue using go in monorepo but I cannot resolve it yet. 🙏

@XxSonicGhostxX
Copy link

what do i have to do exaclly?
did clicking on the release-please do it fully in all aspects?
i also ran
$~ npm -i release-please -g
said 200 packages downloaded and 30 are looking to be funded.. on my mac osx . the pred linux that is built ubuntu is compleately screwed up its got a min of its own we go threw it lol. hense my confustion it seems to have malware of somekind..how do i go about this ? i hope someone has some insights or guidence on whats next

also are you talking to me regardjng the name? im wanting to release please ..i just wsnt want security complience and control above all so i can get to working on building something that will benifit . i want to learn and contribute moving foward aslong as i can understand fully all consepts and implmentations in project/s casue i'am alittle lost.in some areas,atleast most the basic concepts that is vital to fulldisclourse and thrive in this feild so i could really benifit from being able to discuss things with someone here that knows alot if not the one who wrote most of the code . is there another chat sonewhere i can be guided to and get ahold of that person? sovwhat exacky are you trying to do? sorry i havent fully made a secret in actions yet as i had to find out how to configure that an i had a few rl events also i have to take care of. sadily untill i can pay bills from this feild ill always be in and out unfortunately.. if youre wsnting in me to get a action done..i think. idk how to tell if a post or issue pr is to me. other then breadcrubsb.
thank you for your help in this matter. sorry if im not following a guideline as how specificy to comment on this thread, but im just learning to the "force" ill be jedi warrior one day lol. @Sebastian-0 @shoootyou @coderkakarrot @chingor13 @LucaLanziani

@XxSonicGhostxX
Copy link

so am i needeing to config that json? and the secerts key like you stated above ? so just i make a pr first right whst would it be just "release pr"

@coderkakarrot
Copy link

coderkakarrot commented Mar 21, 2024

@Sebastian-0 I am using monorepo for golang packages. I have removed configuration for the root folder from the release-please-config.json and .release-please-manifest.json.

@shoootyou You can refer to configuration that I am using see if this helps.

release-please-config.json

{
  "include-component-in-tag": true,
  "separate-pull-requests": true,
  "release-type": "go",
  "packages": {
    "cache": {
      "component": "cache",
      "release-type": "go",
      "include-v-in-tag": true,
      "include-component-in-tag": true,
      "extra-labels": ["cache"],
      "tag-separator": "@"
    },
    "metrics": {
      "component": "metrics",
      "release-type": "go",
      "include-v-in-tag": true,
      "include-component-in-tag": true,
      "extra-labels": ["metrics"],
      "tag-separator": "@"
    }
  },
  "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}

.release-please-manifest.json

{
  "cache": "0.0.4",
  "metrics": "0.0.3"
}

release-please.yml

on:
  push:
    branches:
      - main

permissions:
  contents: write
  pull-requests: write

name: release-please

jobs:
  release-please:
    runs-on: ubuntu-latest
    steps:
      - uses: google-github-actions/release-please-action@v4
        with:
          # this assumes that you have created a personal access token
          # (PAT) and configured it as a GitHub action secret named
          # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
          token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
          config-file: release-please-config.json
          manifest-file: .release-please-manifest.json
          include-component-in-tag: true

@Sebastian-0
Copy link
Author

Sebastian-0 commented Mar 22, 2024

@shoootyou The component name is resolved in the following order:

  1. Using component property in release-please-config.json
  2. Using package-name property in release-please-config.json
  3. Using package name from your release-type
    • For simple: empty string
    • For node: name property in package.json
    • For go: empty string
    • etc...

So all you have to do if you're using golang is to set either the property component or package-name for the package, similar to what @coderkakarrot suggested above.

The component property is completely undocumented (doesn't even exist in the json schema), and so are the fallback component names for each release type. I figured it out after digging through the source code 😄

@XxSonicGhostxX
Copy link

Love how you ignored my comment line in not even here don’t help my right

@dilzeem
Copy link

dilzeem commented Apr 23, 2024

Also getting this issue with regards to terraform. It seems like I have to put the component in the packages for this to work.

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

5 participants