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

Running projects scm action -i import -a import-all has no effect #62

Closed
rophy opened this Issue Jan 23, 2017 · 15 comments

Comments

Projects
None yet
8 participants
@rophy

rophy commented Jan 23, 2017

Version: 1.0.5-1
Type: RPM

Steps to reproduce

[tsaiyl@lsc102 ~]$ rd projects scm status -i import
synchState: IMPORT_NEEDED
message: 1 file(s) need to be imported
actions:
  import-all


[tsaiyl@lsc102 ~]$ rd projects scm perform -i import -a import-all
# Action import-all was successful.
# Result: SCM import Action was Successful: import-all
[tsaiyl@lsc102 ~]$ rd projects scm status -i import
synchState: IMPORT_NEEDED
message: 1 file(s) need to be imported
actions:
  import-all

Expected result: after running import-all, syncState should be CLEAN

Actual result: after runing import-all, syncState remains IMPORT_NEEDED

@gschueler

This comment has been minimized.

Show comment
Hide comment
@gschueler

gschueler Jan 23, 2017

Member

you should run rd projects scm inputs -i import -a import-all and view the inputs required, which I think will indicate you need to specify what "items" (files) to import. Those values will have to be specified in the --fields or --item arguments to scm perform -i import -a import-all

Member

gschueler commented Jan 23, 2017

you should run rd projects scm inputs -i import -a import-all and view the inputs required, which I think will indicate you need to specify what "items" (files) to import. Those values will have to be specified in the --fields or --item arguments to scm perform -i import -a import-all

@rophy

This comment has been minimized.

Show comment
Hide comment
@rophy

rophy Jan 26, 2017

Thanks for the info. It seems projects scm inputs -i import -a import-all only show list of items, and does not show which items are out of sync. Is there a way to obtain this info, or a way to specify "select all"?

rophy commented Jan 26, 2017

Thanks for the info. It seems projects scm inputs -i import -a import-all only show list of items, and does not show which items are out of sync. Is there a way to obtain this info, or a way to specify "select all"?

@gschueler

This comment has been minimized.

Show comment
Hide comment
@gschueler

gschueler Jan 27, 2017

Member

I think the API can be updated to include a flag for items which are considered out of sync: that information is available from the plugin, and is used to automatically select items in the GUI for import, but it is not passed through to the API yet.

Member

gschueler commented Jan 27, 2017

I think the API can be updated to include a flag for items which are considered out of sync: that information is available from the plugin, and is used to automatically select items in the GUI for import, but it is not passed through to the API yet.

@gschueler

This comment has been minimized.

Show comment
Hide comment
@gschueler

gschueler Feb 2, 2017

Member

...to clarify, this requires an update to Rundeck API

Member

gschueler commented Feb 2, 2017

...to clarify, this requires an update to Rundeck API

@gonzales-ott-bot

This comment has been minimized.

Show comment
Hide comment
@gonzales-ott-bot

gonzales-ott-bot May 16, 2017

Hi guys. This is actually even more of an issue when trying to deploy a new instance of Rundeck from an already populated git repo.

We are able to setup all the config needed but because of this issue we can not retrieve the items that need to be synced.

Import remote Changes: Import the modifications to Rundeck
Fields:

Items:
java.lang.NullPointerException
	at org.rundeck.client.api.model.ScmImportItem.toMap(ScmImportItem.java:38)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at org.rundeck.client.tool.commands.projects.SCM.inputs(SCM.java:254)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.simplifyops.toolbelt.ToolBelt$MethodInvoker.run(ToolBelt.java:778)
	at com.simplifyops.toolbelt.ToolBelt$CommandSet.runCommand(ToolBelt.java:492)
	at com.simplifyops.toolbelt.ToolBelt$CommandSet.run(ToolBelt.java:359)
	at com.simplifyops.toolbelt.ToolBelt$CommandSet.runCommand(ToolBelt.java:492)
	at com.simplifyops.toolbelt.ToolBelt$CommandSet.run(ToolBelt.java:359)
	at com.simplifyops.toolbelt.ToolBelt$CommandSet.runCommand(ToolBelt.java:492)
	at com.simplifyops.toolbelt.ToolBelt$CommandSet.run(ToolBelt.java:359)
	at com.simplifyops.toolbelt.ToolBelt$CommandSet.runMain(ToolBelt.java:322)
	at org.rundeck.client.tool.Main.main(Main.java:56)

gonzales-ott-bot commented May 16, 2017

Hi guys. This is actually even more of an issue when trying to deploy a new instance of Rundeck from an already populated git repo.

We are able to setup all the config needed but because of this issue we can not retrieve the items that need to be synced.

Import remote Changes: Import the modifications to Rundeck
Fields:

Items:
java.lang.NullPointerException
	at org.rundeck.client.api.model.ScmImportItem.toMap(ScmImportItem.java:38)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at org.rundeck.client.tool.commands.projects.SCM.inputs(SCM.java:254)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.simplifyops.toolbelt.ToolBelt$MethodInvoker.run(ToolBelt.java:778)
	at com.simplifyops.toolbelt.ToolBelt$CommandSet.runCommand(ToolBelt.java:492)
	at com.simplifyops.toolbelt.ToolBelt$CommandSet.run(ToolBelt.java:359)
	at com.simplifyops.toolbelt.ToolBelt$CommandSet.runCommand(ToolBelt.java:492)
	at com.simplifyops.toolbelt.ToolBelt$CommandSet.run(ToolBelt.java:359)
	at com.simplifyops.toolbelt.ToolBelt$CommandSet.runCommand(ToolBelt.java:492)
	at com.simplifyops.toolbelt.ToolBelt$CommandSet.run(ToolBelt.java:359)
	at com.simplifyops.toolbelt.ToolBelt$CommandSet.runMain(ToolBelt.java:322)
	at org.rundeck.client.tool.Main.main(Main.java:56)
@gschueler

This comment has been minimized.

Show comment
Hide comment
@gschueler

gschueler May 16, 2017

Member

@gonzales-ott-bot that's another issue, i will file it: #99

Member

gschueler commented May 16, 2017

@gonzales-ott-bot that's another issue, i will file it: #99

@lcardito

This comment has been minimized.

Show comment
Hide comment
@lcardito

lcardito May 16, 2017

Hi @gschueler thanks for this.

Do we have a reference for the Rundeck API update needed for this?

lcardito commented May 16, 2017

Hi @gschueler thanks for this.

Do we have a reference for the Rundeck API update needed for this?

@gschueler

This comment has been minimized.

Show comment
Hide comment
@gschueler

gschueler May 16, 2017

Member

@lcardito for the rundeck API improvement, here is the issue: rundeck/rundeck#2330

Member

gschueler commented May 16, 2017

@lcardito for the rundeck API improvement, here is the issue: rundeck/rundeck#2330

@jodylarsen

This comment has been minimized.

Show comment
Hide comment
@jodylarsen

jodylarsen Jun 6, 2017

why isn't the correct behavior for --action import-all to import all changes? Adding a requirement to list out individual jobs with status, parse the status, and then call again the command line again using --fields or --item seem unnecessarily complex.

jodylarsen commented Jun 6, 2017

why isn't the correct behavior for --action import-all to import all changes? Adding a requirement to list out individual jobs with status, parse the status, and then call again the command line again using --fields or --item seem unnecessarily complex.

@gschueler

This comment has been minimized.

Show comment
Hide comment
@gschueler

gschueler Jul 6, 2017

Member

@jodylarsen import-all is incorrectly named, it should be called import-jobs, it only imports the jobs/files that are specified. Another solution would be to modify the git plugin to add an action that actually does import all potential changes without needing to specify them.

Member

gschueler commented Jul 6, 2017

@jodylarsen import-all is incorrectly named, it should be called import-jobs, it only imports the jobs/files that are specified. Another solution would be to modify the git plugin to add an action that actually does import all potential changes without needing to specify them.

@Wambosa

This comment has been minimized.

Show comment
Hide comment
@Wambosa

Wambosa Sep 6, 2017

i was about to create a new issue for this, but just stumbled on this thread. I'll post my path to reproduce anyways and +1 this. i spent my evening yesterday and most of this morning confused by the verbiage "import-all". Additionally i tried to use "remote-pull", but it seems like you cannot skip actions.

I understand that this could be addressed at the API level first. I'll take a look at the plugin real quick to see if anything has developed.

rd projects create -p ops
rd projects configure set -p ops --file ~/project.properties
rd keys create --type privateKey --path keys/lib/rundeck/.ssh/github_rsa --file ~/github_rsa
rd projects scm setup -p ops --integration import --type git-import --file ~/scm-import.json
rd projects scm perform -p ops -i import --action initialize-tracking -f useFilePattern="true" filePattern=".*\\.yaml"

#the import all will respond with false positive success, and not actually do anything
rd projects scm perform -i import -p ops --action import-all

#this one works and gives the same success message as the prior command
rd projects scm perform -i import -p ops --action import-all --item "ops/my-job-file.yaml"

Wambosa commented Sep 6, 2017

i was about to create a new issue for this, but just stumbled on this thread. I'll post my path to reproduce anyways and +1 this. i spent my evening yesterday and most of this morning confused by the verbiage "import-all". Additionally i tried to use "remote-pull", but it seems like you cannot skip actions.

I understand that this could be addressed at the API level first. I'll take a look at the plugin real quick to see if anything has developed.

rd projects create -p ops
rd projects configure set -p ops --file ~/project.properties
rd keys create --type privateKey --path keys/lib/rundeck/.ssh/github_rsa --file ~/github_rsa
rd projects scm setup -p ops --integration import --type git-import --file ~/scm-import.json
rd projects scm perform -p ops -i import --action initialize-tracking -f useFilePattern="true" filePattern=".*\\.yaml"

#the import all will respond with false positive success, and not actually do anything
rd projects scm perform -i import -p ops --action import-all

#this one works and gives the same success message as the prior command
rd projects scm perform -i import -p ops --action import-all --item "ops/my-job-file.yaml"

@gschueler gschueler closed this in c23301c Nov 16, 2017

gschueler added a commit that referenced this issue Nov 16, 2017

Merge pull request #134 from rundeck/issue/62
Fix #62 add flags to scm perform to include items automatically
@gschueler

This comment has been minimized.

Show comment
Hide comment
@gschueler

gschueler Nov 20, 2017

Member

fyi: this flag was added to rd projects scm perform: --allitems

See #134

Member

gschueler commented Nov 20, 2017

fyi: this flag was added to rd projects scm perform: --allitems

See #134

@tsaiyl

This comment has been minimized.

Show comment
Hide comment
@tsaiyl

tsaiyl Nov 21, 2017

@gschueler So glad to see this addressed! Since we talked about updating API, Is there a required specific rundeck version for this to work?

tsaiyl commented Nov 21, 2017

@gschueler So glad to see this addressed! Since we talked about updating API, Is there a required specific rundeck version for this to work?

@gschueler

This comment has been minimized.

Show comment
Hide comment
@gschueler

gschueler Nov 21, 2017

Member

@tsaiyl no, it uses 2 api calls instead and does not require any change on the server

Member

gschueler commented Nov 21, 2017

@tsaiyl no, it uses 2 api calls instead and does not require any change on the server

@madcrokodile

This comment has been minimized.

Show comment
Hide comment
@madcrokodile

madcrokodile Mar 15, 2018

working command now is
rd projects scm perform -i import -p MyProject --action import-all --allitems

madcrokodile commented Mar 15, 2018

working command now is
rd projects scm perform -i import -p MyProject --action import-all --allitems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment