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

Remove sign and annotate tag from releasing tools #6797

Merged
merged 2 commits into from
Jun 24, 2024

Conversation

Desvelao
Copy link
Member

@Desvelao Desvelao commented Jun 21, 2024

Description

This pull request move the sign and annotation of tag created by the releasing tool to optional.

This causes the default tag is not signed or annotated to solve a problem with incompatibility of signed or annotated tags with the building process of Wazuh dashboard using a reusable workflow of plugins repository.

Issues Resolved

#6795

Evidence

[INFO][tag]: Run command: git tag v4.9.0-test-removeme
[INFO][tag]: Created tag: v4.9.0-test-removeme
[INFO][tag]: Run command: git push origin v4.9.0-test-removeme
remote: This repository moved. Please use the new location:        
remote:   https://github.com/wazuh/wazuh-dashboard-plugins.git        
To https://github.com/wazuh/wazuh-kibana-app.git
 * [new tag]             v4.9.0-test-removeme -> v4.9.0-test-removeme
[INFO][tag]: Pushed tag v4.9.0-test-removeme to remote
[INFO][tag]: Run command: git reset --hard origin/4.9.0
[INFO][tag]: Undone changes.

Test

Ensure the tag.gpgsign is unset or false in the git configuration.

Legend:
⚫: none
🟢: pass
🟡: warning
🔴: fail
⚪: not applicable

Other

Test Result
Create a tag without signing or annotating through the tag releasing tool

Details

⚫ Create a tag without signing or annotating through the tag releasing tool

Check List

  • All tests pass
    • yarn test:jest
  • Commits are signed per the DCO using --signoff

Sign and annotate the tag created by the tag release tool was moved
to be optional through parameters. This lets its usage if were
required on the future.

The signed/annotated tag causes a problem in the build of Wazuh
dashboard thorugh GHA workflow that uses a reusable workflow to
build the plugins of this repository. This means, the tags that
could be used to build packages of Wazuh dashboard SHOULD NOT
be signed or annotated.
Copy link
Contributor

Wazuh Core plugin code coverage (Jest) test % values
Statements 45.96% ( 399 / 868 )
Branches 41.97% ( 157 / 374 )
Functions 44.01% ( 136 / 309 )
Lines 46.16% ( 397 / 860 )

Copy link
Contributor

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 76.44% ( 172 / 225 )
Branches 58.65% ( 61 / 104 )
Functions 61.7% ( 29 / 47 )
Lines 76.44% ( 172 / 225 )

@Desvelao Desvelao marked this pull request as ready for review June 21, 2024 12:21
Copy link
Contributor

Main plugin code coverage (Jest) test % values
Statements 12.19% ( 3992 / 32724 )
Branches 8.11% ( 1743 / 21484 )
Functions 11.71% ( 944 / 8057 )
Lines 12.38% ( 3889 / 31393 )

Copy link
Member

@Tostti Tostti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test

$ node scripts/release/tag.js --plugins-directory ./plugins --manifest-changelog ./CHANGELOG.md --manifest-package ./plugins/main/package.json --plugin-main-generate-api-data-spec https://raw.githubusercontent.com/wazuh/wazuh/4.9.0/api/api/spec/spec.yaml --version 4.9.0 --revision 03 --platform-version 2.13.0 --tag-suffix -removeUnsigned
[INFO][tag]: Version: 4.9.0
[INFO][tag]: Revision: 03
[INFO][tag]: Platform version: 2.13.0
[INFO][tag]: Tag suffix: -removeUnsigned
[INFO][tag]: Sign tag: no
[INFO][tag]: Annotate tag: no
[INFO][tag]: Tag name: v4.9.0-removeUnsigned
[WARN][tag]: Ensure the base branch is created in the remote and it has updated the files that are not modified by the bump process. See RELEASING.md.
[WARN][tag]: This script will prune the local branches and tags, bump the plugins, commit and push the tags to the remote repository, deleting any unpushed changes. It is required you have configurated the repository to sign the commit and tag creation.
Do you want to continue? [y/N] y
[INFO][tag]: Run command: git checkout 4.9.0
Switched to branch '4.9.0'
[INFO][tag]: Switched to branch: 4.9.0
[INFO][tag]: Run command: git fetch --prune --prune-tags --force
[INFO][tag]: Pruned local branches and tags
[INFO][tag]: Generating tag: v4.9.0-removeUnsigned...
[INFO][bump]: Plugin directories from ./plugins: main, wazuh-check-updates, wazuh-core
[INFO][bump][main]: Version: 4.9.0
[INFO][bump][main]: Revision: 03
[INFO][bump][main]: Platform version: 2.13.0
[INFO][bump][main]: Package manifest: /home/tostti/src/wazuh-dashboard-plugins/plugins/main/package.json
[INFO][bump][main]: Plugin manifest: /home/tostti/src/wazuh-dashboard-plugins/plugins/main/opensearch_dashboards.json
[INFO][bump][main]: This will update the manifest files: package and platform plugin.
[INFO][bump][main]: Updated /home/tostti/src/wazuh-dashboard-plugins/plugins/main/package.json
[INFO][bump][main]: Updated /home/tostti/src/wazuh-dashboard-plugins/plugins/main/opensearch_dashboards.json
[INFO][bump][main]: Calling to specific bump script
[INFO][bump][main][specific]: Run command: cd /home/tostti/src/wazuh-dashboard-plugins/plugins/main && yarn generate:api-data --spec https://raw.githubusercontent.com/wazuh/wazuh/4.9.0/api/api/spec/spec.yaml
{
  displayConfiguration: true,
  displayExamples: false,
  displayHelp: false,
  format: 'plugin',
  output: 'file',
  spec: 'https://raw.githubusercontent.com/wazuh/wazuh/4.9.0/api/api/spec/spec.yaml',
  outputDirectory: '/home/tostti/src/wazuh-dashboard-plugins/plugins/main/common/api-info'
}
yarn run v1.22.22
$ node scripts/generate-api-data.js --spec https://raw.githubusercontent.com/wazuh/wazuh/$(node -e "console.log(require('./package.json').version)")/api/api/spec/spec.yaml --output file --output-directory common/api-info --display-configuration --spec https://raw.githubusercontent.com/wazuh/wazuh/4.9.0/api/api/spec/spec.yaml
File was created! Path: /home/tostti/src/wazuh-dashboard-plugins/plugins/main/common/api-info/security-actions.json
File was created! Path: /home/tostti/src/wazuh-dashboard-plugins/plugins/main/common/api-info/endpoints.json
Done in 0.88s.

[INFO][bump][wazuh-check-updates]: Version: 4.9.0
[INFO][bump][wazuh-check-updates]: Revision: 03
[INFO][bump][wazuh-check-updates]: Platform version: 2.13.0
[INFO][bump][wazuh-check-updates]: Package manifest: /home/tostti/src/wazuh-dashboard-plugins/plugins/wazuh-check-updates/package.json
[INFO][bump][wazuh-check-updates]: Plugin manifest: /home/tostti/src/wazuh-dashboard-plugins/plugins/wazuh-check-updates/opensearch_dashboards.json
[INFO][bump][wazuh-check-updates]: This will update the manifest files: package and platform plugin.
[INFO][bump][wazuh-check-updates]: Updated /home/tostti/src/wazuh-dashboard-plugins/plugins/wazuh-check-updates/package.json
[INFO][bump][wazuh-check-updates]: Updated /home/tostti/src/wazuh-dashboard-plugins/plugins/wazuh-check-updates/opensearch_dashboards.json
[INFO][bump][wazuh-core]: Version: 4.9.0
[INFO][bump][wazuh-core]: Revision: 03
[INFO][bump][wazuh-core]: Platform version: 2.13.0
[INFO][bump][wazuh-core]: Package manifest: /home/tostti/src/wazuh-dashboard-plugins/plugins/wazuh-core/package.json
[INFO][bump][wazuh-core]: Plugin manifest: /home/tostti/src/wazuh-dashboard-plugins/plugins/wazuh-core/opensearch_dashboards.json
[INFO][bump][wazuh-core]: This will update the manifest files: package and platform plugin.
[INFO][bump][wazuh-core]: Updated /home/tostti/src/wazuh-dashboard-plugins/plugins/wazuh-core/package.json
[INFO][bump][wazuh-core]: Updated /home/tostti/src/wazuh-dashboard-plugins/plugins/wazuh-core/opensearch_dashboards.json
[INFO][bump]: Updated ./CHANGELOG.md
Review the changes done with the bump. y (continue), d (list changes: git diff), f (list modified files: git diff --name-only), N/n (cancel) y
[INFO][tag]: Run command: git diff --exit-code --no-patch;echo -n $?
[INFO][tag]: There are changes to commit.
[INFO][tag]: Run command: git diff --name-only
CHANGELOG.md
plugins/main/opensearch_dashboards.json
plugins/main/package.json
plugins/wazuh-check-updates/opensearch_dashboards.json
plugins/wazuh-check-updates/package.json
plugins/wazuh-core/opensearch_dashboards.json
plugins/wazuh-core/package.json

[INFO][tag]: Run command: git commit -S -am "Bump v4.9.0-removeUnsigned"
[INFO][tag]: Commited
[INFO][tag]: Run command: git tag v4.9.0-removeUnsigned
[INFO][tag]: Created tag: v4.9.0-removeUnsigned
[INFO][tag]: Run command: git push origin v4.9.0-removeUnsigned
To github.com:wazuh/wazuh-dashboard-plugins.git
 * [new tag]             v4.9.0-removeUnsigned -> v4.9.0-removeUnsigned
[INFO][tag]: Pushed tag v4.9.0-removeUnsigned to remote
[INFO][tag]: Run command: git reset --hard origin/4.9.0
[INFO][tag]: Undone changes.
[WARN][tag]: A commit was added to the tag, but the branch 4.9.0 was reset to the state of the remote.git checkout -f change/6795-remove-sign-annotate-tag-release-tool
Switched to branch 'change/6795-remove-sign-annotate-tag-release-tool'
Your branch is up to date with 'origin/change/6795-remove-sign-annotate-tag-release-tool'.
 node scripts/release/tag.js --plugins-directory ./plugins --manifest-changelog ./CHANGELOG.md --manifest-package ./plugins/main/package.json --plugin-main-generate-api-data-spec https://raw.githubusercontent.com/wazuh/wazuh/4.9.0/api/api/spec/spec.yaml --version 4.9.0 --revision 03 --platform-version 2.13.0 --tag-suffix -removeSigned --tag-annotate --tag-sign
[INFO][tag]: Version: 4.9.0
[INFO][tag]: Revision: 03
[INFO][tag]: Platform version: 2.13.0
[INFO][tag]: Tag suffix: -removeSigned
[INFO][tag]: Sign tag: yes
[INFO][tag]: Annotate tag: yes
[INFO][tag]: Tag name: v4.9.0-removeSigned
[WARN][tag]: Ensure the base branch is created in the remote and it has updated the files that are not modified by the bump process. See RELEASING.md.
[WARN][tag]: This script will prune the local branches and tags, bump the plugins, commit and push the tags to the remote repository, deleting any unpushed changes. It is required you have configurated the repository to sign the commit and tag creation.
Do you want to continue? [y/N] y
[INFO][tag]: Run command: git checkout 4.9.0
Switched to branch '4.9.0'
[INFO][tag]: Switched to branch: 4.9.0
[INFO][tag]: Run command: git fetch --prune --prune-tags --force
[INFO][tag]: Pruned local branches and tags
[INFO][tag]: Generating tag: v4.9.0-removeSigned...
[INFO][bump]: Plugin directories from ./plugins: main, wazuh-check-updates, wazuh-core
[INFO][bump][main]: Version: 4.9.0
[INFO][bump][main]: Revision: 03
[INFO][bump][main]: Platform version: 2.13.0
[INFO][bump][main]: Package manifest: /home/tostti/src/wazuh-dashboard-plugins/plugins/main/package.json
[INFO][bump][main]: Plugin manifest: /home/tostti/src/wazuh-dashboard-plugins/plugins/main/opensearch_dashboards.json
[INFO][bump][main]: This will update the manifest files: package and platform plugin.
[INFO][bump][main]: Updated /home/tostti/src/wazuh-dashboard-plugins/plugins/main/package.json
[INFO][bump][main]: Updated /home/tostti/src/wazuh-dashboard-plugins/plugins/main/opensearch_dashboards.json
[INFO][bump][main]: Calling to specific bump script
[INFO][bump][main][specific]: Run command: cd /home/tostti/src/wazuh-dashboard-plugins/plugins/main && yarn generate:api-data --spec https://raw.githubusercontent.com/wazuh/wazuh/4.9.0/api/api/spec/spec.yaml
{
  displayConfiguration: true,
  displayExamples: false,
  displayHelp: false,
  format: 'plugin',
  output: 'file',
  spec: 'https://raw.githubusercontent.com/wazuh/wazuh/4.9.0/api/api/spec/spec.yaml',
  outputDirectory: '/home/tostti/src/wazuh-dashboard-plugins/plugins/main/common/api-info'
}
yarn run v1.22.22
$ node scripts/generate-api-data.js --spec https://raw.githubusercontent.com/wazuh/wazuh/$(node -e "console.log(require('./package.json').version)")/api/api/spec/spec.yaml --output file --output-directory common/api-info --display-configuration --spec https://raw.githubusercontent.com/wazuh/wazuh/4.9.0/api/api/spec/spec.yaml
File was created! Path: /home/tostti/src/wazuh-dashboard-plugins/plugins/main/common/api-info/security-actions.json
File was created! Path: /home/tostti/src/wazuh-dashboard-plugins/plugins/main/common/api-info/endpoints.json
Done in 0.91s.

[INFO][bump][wazuh-check-updates]: Version: 4.9.0
[INFO][bump][wazuh-check-updates]: Revision: 03
[INFO][bump][wazuh-check-updates]: Platform version: 2.13.0
[INFO][bump][wazuh-check-updates]: Package manifest: /home/tostti/src/wazuh-dashboard-plugins/plugins/wazuh-check-updates/package.json
[INFO][bump][wazuh-check-updates]: Plugin manifest: /home/tostti/src/wazuh-dashboard-plugins/plugins/wazuh-check-updates/opensearch_dashboards.json
[INFO][bump][wazuh-check-updates]: This will update the manifest files: package and platform plugin.
[INFO][bump][wazuh-check-updates]: Updated /home/tostti/src/wazuh-dashboard-plugins/plugins/wazuh-check-updates/package.json
[INFO][bump][wazuh-check-updates]: Updated /home/tostti/src/wazuh-dashboard-plugins/plugins/wazuh-check-updates/opensearch_dashboards.json
[INFO][bump][wazuh-core]: Version: 4.9.0
[INFO][bump][wazuh-core]: Revision: 03
[INFO][bump][wazuh-core]: Platform version: 2.13.0
[INFO][bump][wazuh-core]: Package manifest: /home/tostti/src/wazuh-dashboard-plugins/plugins/wazuh-core/package.json
[INFO][bump][wazuh-core]: Plugin manifest: /home/tostti/src/wazuh-dashboard-plugins/plugins/wazuh-core/opensearch_dashboards.json
[INFO][bump][wazuh-core]: This will update the manifest files: package and platform plugin.
[INFO][bump][wazuh-core]: Updated /home/tostti/src/wazuh-dashboard-plugins/plugins/wazuh-core/package.json
[INFO][bump][wazuh-core]: Updated /home/tostti/src/wazuh-dashboard-plugins/plugins/wazuh-core/opensearch_dashboards.json
[INFO][bump]: Updated ./CHANGELOG.md
Review the changes done with the bump. y (continue), d (list changes: git diff), f (list modified files: git diff --name-only), N/n (cancel) y
[INFO][tag]: Run command: git diff --exit-code --no-patch;echo -n $?
[INFO][tag]: There are changes to commit.
[INFO][tag]: Run command: git diff --name-only
CHANGELOG.md
plugins/main/opensearch_dashboards.json
plugins/main/package.json
plugins/wazuh-check-updates/opensearch_dashboards.json
plugins/wazuh-check-updates/package.json
plugins/wazuh-core/opensearch_dashboards.json
plugins/wazuh-core/package.json

[INFO][tag]: Run command: git commit -S -am "Bump v4.9.0-removeSigned"
[INFO][tag]: Commited
[INFO][tag]: Run command: git tag -s -m "Wazuh plugins for Wazuh dashboard v4.9.0-removeSigned" -a v4.9.0-removeSigned
[INFO][tag]: Created tag: v4.9.0-removeSigned
[INFO][tag]: Run command: git push origin v4.9.0-removeSigned
To github.com:wazuh/wazuh-dashboard-plugins.git
 * [new tag]             v4.9.0-removeSigned -> v4.9.0-removeSigned
[INFO][tag]: Pushed tag v4.9.0-removeSigned to remote
[INFO][tag]: Run command: git reset --hard origin/4.9.0
[INFO][tag]: Undone changes.
[WARN][tag]: A commit was added to the tag, but the branch 4.9.0 was reset to the state of the remote.

image

image

CR ✅
TEST ✅

LGTM

@Desvelao Desvelao merged commit f14a840 into 4.9.0 Jun 24, 2024
4 checks passed
@Desvelao Desvelao deleted the change/6795-remove-sign-annotate-tag-release-tool branch June 24, 2024 10:57
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