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

Cannot force regeneration of metadata on RightScript #71

Open
erikhjensen opened this issue Sep 3, 2019 · 4 comments
Open

Cannot force regeneration of metadata on RightScript #71

erikhjensen opened this issue Sep 3, 2019 · 4 comments

Comments

@erikhjensen
Copy link

https://github.com/rightscale/right_st/blob/a4850023a2c74acefb0dd43c46a3611c87fb0efa/scaffold.go#L50

We are working with your consulting services and I just tried to force scaffolding to regenerate the metadata in the following use-case.

User has an RS that they want to clone and test a new version,
User copies the RS, adds their username/initials as a prefix
(if they uploaded now, despite the new filename, it'd obey metadata and not create that new clone)
So we add the force parameter to the tool, and it does not re-generate the metadata.

in your code, it looks like you have the following logic:
if metadata exists
if not force
show them a message
--no else for "if not force"
else generate fresh metadata.

i've written my own code to clear the metadata but based on your readme, i'm wondering if this code just has a bug whereby it's missing the else condition to overwrite metadata for a forced file which already had metadata.

@douglaswth
Copy link
Contributor

I'm not sure I fully understand your use-case, but it seems like perhaps you should be using the --prefix option when uploading a RightScript. This will prepend the user's prefix (which could be their username/initials) to the name of the RightScript that it uploads just as it seems you want.

@erikhjensen
Copy link
Author

erikhjensen commented Sep 3, 2019 via email

@douglaswth
Copy link
Contributor

Okay, I think I see where the confusion is arising: the force only updates detected inputs and attachments in the script and not the name or description. The assumption there is that perhaps you have added some new variables or paths while updating your script, so you would force the scaffold to happen in order to add those new inputs or attachments to the metadata while if you wanted to change the name or description of something, you would edit the metadata comment directly.

Given that you would already be using Git (or any other version control system), I definitely suggest the second approach you've listed:

  1.  User makes a branch
    
  2.  Edits the rightscript in question
    
  3.  CI/CD realizes it’s on a branch and calls upload w/ the prefix flag so that the rightscale file can exist in the catalogue side by side w/ its ancestor.
    

Especially if the end goal is to eventually merge the feature branch and upload the merged script in the main lineage.

@erikhjensen
Copy link
Author

erikhjensen commented Sep 3, 2019 via email

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

2 participants