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

(PDK-624) Add UpdateManager class to handle making changes to module files #355

Merged
merged 1 commit into from
Nov 28, 2017

Conversation

rodjek
Copy link
Contributor

@rodjek rodjek commented Nov 22, 2017

Abstracts away the file modification logic into its own class. This will allow
easy reuse for the future pdk update as well as a simple interface for
storing the pending changes in memory rather than on disk (less cleanup
required in the event of an interrupt). The presentation/reporting of the changes
has been separated from the logic that makes the changes, so that we can easily
tweak and modify the output as this feature develops.


An example where my metadata.json was missing the license field.

asmodean :0: pdk/foo (git:master → origin {2} U:3 ?:2!)$ ../bin/pdk convert
pdk (INFO): This is a potentially destructive action. Please ensure that you have committed it to a version control system or have a backup before continuing.
Do you want to continue converting this module? Yes
--- metadata.json	2017-11-22 14:19:03.616567876 +1100
+++ metadata.json.pdknew	2017-11-22 14:20:21.076163844 +1100
@@ -2,6 +2,7 @@
   "name": "rodjek-test",
   "author": "rodjek",
   "summary": "",
+  "license": "Apache-2.0",
   "source": "",
   "dependencies": [
 
Do you want to continue and make these changes to your module? Yes
asmodean :0: pdk/foo (git:master → origin {2} U:3 ?:2!)$ cat metadata.json 
{
  "name": "rodjek-test",
  "author": "rodjek",
  "summary": "",
  "license": "Apache-2.0",
  "source": "",
  "dependencies": [

  ],
  "operatingsystem_support": [
    {
      "operatingsystem": "Debian",
      "operatingsystemrelease": [
        "8"
      ]
    },
    {
      "operatingsystem": "RedHat",
      "operatingsystemrelease": [
        "7.0"
      ]
    },
    {
      "operatingsystem": "Ubuntu",
      "operatingsystemrelease": [
        "16.04"
      ]
    },
    {
      "operatingsystem": "windows",
      "operatingsystemrelease": [
        "2012 R2"
      ]
    }
  ],
  "requirements": [

  ]
}

@rodjek rodjek force-pushed the pdk-624 branch 6 times, most recently from 223ad1d to 3ba0080 Compare November 23, 2017 01:31
@puppetlabs puppetlabs deleted a comment from coveralls Nov 23, 2017
@puppetlabs puppetlabs deleted a comment from coveralls Nov 23, 2017
@puppetlabs puppetlabs deleted a comment from coveralls Nov 23, 2017
@puppetlabs puppetlabs deleted a comment from coveralls Nov 23, 2017
@puppetlabs puppetlabs deleted a comment from coveralls Nov 23, 2017
@puppetlabs puppetlabs deleted a comment from coveralls Nov 23, 2017
@puppetlabs puppetlabs deleted a comment from coveralls Nov 23, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.5%) to 93.052% when pulling 5bc5de2 on rodjek:pdk-624 into 8f61011 on puppetlabs:master.

…files

Abstracts away the file modification logic into its own class. This will allow
easy reuse for the future `pdk update` as well as a simple interface for
storing the pending changes in memory rather than on disk (less cleanup
required in the event of an interrupt).
@coveralls
Copy link

Coverage Status

Coverage increased (+0.5%) to 93.058% when pulling 2ef10f6 on rodjek:pdk-624 into 8f61011 on puppetlabs:master.

@rodjek rodjek changed the title [WIP] (PDK-624) Add UpdateManager class to handle making changes to module files (PDK-624) Add UpdateManager class to handle making changes to module files Nov 24, 2017
@bmjen bmjen merged commit accfd0f into puppetlabs:master Nov 28, 2017
@rodjek rodjek deleted the pdk-624 branch November 28, 2017 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants