Skip to content

Conversation

@olblak
Copy link
Member

@olblak olblak commented Nov 23, 2022

Signed-off-by: Olblak [email protected]

This pullrequest allows to manipulate git branch similarly to the gittag

Test

To test this pull request, you can run the following commands:

cp <to_package_directory>
go test

Additional Information

Tradeoff

Potential improvement

While implementing this PR, I noticed that the gittag resource use versionfilter for condition and target.
I am not anymore sure that it was the right approach back then.
In this PR, I decided to use versionfilter only for source and use the setting branch for condition target

@olblak olblak marked this pull request as draft November 23, 2022 19:44
@olblak
Copy link
Member Author

olblak commented Nov 24, 2022

While testing the Git Branch creation, I got affected by #632 (comment)

The target operation fails if no files need to be published. This is the expected behavior for the gitbranch plugin to work

TARGETS
========

alreadyexist
------------
✔ The Git branch "master" already exists, nothing else to do.
✔ The git branch "master" already exist on the specified remote.

default
-------
⚠ The git branch "v1" does not exist: creating it.
⚠ The git branch "v1" has been created.
git branch "v1" has been created.

Create a pull request for 'v1' on GitHub by visiting:
     https://github.com/olblak/nocode/pull/new/v1

⚠ The git branch "v1" was pushed successfully to the specified remote.

ERROR: something went wrong in target "default" : "no changed file to commit"

Pipeline "GITBRANCH.YAML" failed
Skipping due to:
	targets stage:	"something went wrong during target execution"

=============================

REPORTS:


✗ GITBRANCH.YAML:
	Source:
		✔ [default] Get Latest committed branch (kind: gitbranch)
	Condition:
		✔ [default] Get Latest committed branch (kind: gitbranch)
		✔ [master] Get Latest committed branch (kind: gitbranch)
	Target:
		✔ [alreadyexist] Test that the branch already exist. (kind: gitbranch)
		✗ [default] Create the branch v1 if needed (kind: gitbranch)


Run Summary
===========
Pipeline(s) run:
  * Changed:	0
  * Failed:	1
  * Skipped:	0
  * Succeeded:	0
  * Total:	1
ERROR: ✗ 1 over 1 pipeline failed
ERROR: command failed
[1]    22549 exit 1     ./bin/updatecli apply --config e2e/updatecli.d/success.d/gitBranch.yaml

Earlier today @dduportal made a few interesting suggestion

olblak: in the case of gittag (and gitbranch if implemented for targets) targets, would that make sense to add the .git file as the changed file?
olblak: I'm also working on removing the concept of SCM from targets (to delegate it to actions only). As part of this experiment, I thought about how the plugin should handle themselves the return status (instead of trying magically to determine it).
olblak: OH. Can you share your manifest with this error please, I think I have an idea. (TL;DR; you don't need an scmid for a target of kind gittag)

@olblak olblak added the enhancement New feature or request label Nov 24, 2022
@olblak olblak marked this pull request as ready for review December 27, 2022 20:44
@olblak olblak mentioned this pull request Jan 3, 2023
2 tasks
@olblak olblak added this to the 0.46.0 milestone Jan 23, 2023
@olblak olblak enabled auto-merge (squash) February 1, 2023 08:25
@olblak olblak modified the milestones: 0.46.0, 0.44.0 Feb 1, 2023
@olblak olblak merged commit f6484ab into updatecli:main Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request resource-gitbranch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant