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 console --puppet-dev does not grab latest Puppet source #764

Closed
logicminds opened this issue Oct 2, 2019 · 0 comments · Fixed by #792
Closed

pdk console --puppet-dev does not grab latest Puppet source #764

logicminds opened this issue Oct 2, 2019 · 0 comments · Fixed by #792
Assignees
Labels
Milestone

Comments

@logicminds
Copy link
Contributor

Describe the bug
Expected that when using --puppet-dev the pdk would update the src code under ~/.pdk/cache/src/puppet. However it did not run git pull to update and was still pointing to an older version.

I don't know the feature set for this but if pdk is suppose to pull the latest this would be cool.

To Reproduce

  1. pdk console --puppet-dev (once) just to seed the source code under the cache
  2. goto ~/.pdk/cache/src/puppet and manipulate the HEAD
  3. git reset --hard HEAD~30 or something
  4. pdk console --puppet-dev (again)

Expected behavior
The expected behavior is the that the version of puppet would reflect the latest commit in the source. So for today this was puppet 6.11. Although I am using the pdk console command here I would expect this to also occur in other commands.

Ruby Version: 2.5.3
Puppet Version: 6.11.0
Puppet Debugger Version: 0.14.0
Created by: NWOps <corey@nwops.io>
Type "commands" for a list of debugger commands
or "help" to show the help screen.

1:>>
@logicminds logicminds added bug needs-triage Newly created issue that has not been reviewed by a PDK contributor labels Oct 2, 2019
@scotje scotje added bug and removed bug needs-triage Newly created issue that has not been reviewed by a PDK contributor labels Oct 22, 2019
@scotje scotje added this to the November 2019 milestone Oct 22, 2019
@rodjek rodjek self-assigned this Oct 28, 2019
rodjek added a commit to rodjek/pdk that referenced this issue Oct 28, 2019
The original issue was that `pdk console --puppet-dev` didn't update the
checkout before using it. This is because the CLI for `pdk console`
didn't call `PDK::Util::PuppetVersion.fetch_puppet_dev`. Rather than add
that, I've opted to add this call to the logic in
`PDK::CLI::Util.puppet_from_opts_or_env` so that it happens
automatically when setting up the environment for puppet-dev.

---

First run to seed the checkout
```
$ pdk console --puppet-dev
pdk (WARN): Module fixtures not found, please run pdk bundle exec rake spec_prep.
[✔] Installing missing Gemfile dependencies.
Ruby Version: 2.4.7
Puppet Version: 6.10.1
Puppet Debugger Version: 0.15.1
Created by: NWOps <corey@nwops.io>
Type "commands" for a list of debugger commands
or "help" to show the help screen.

1:>>
```

Manually switch the checkout to Puppet 6.9.0
```
$ git -C ~/.pdk/cache/src/puppet checkout 6.9.0
Note: switching to '6.9.0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at c2ccdd4efe Merge pull request #7706 from gimmyxd/PUP-10016
```

Second run, showing that the checkout has been updated to the HEAD of
origin/master (at time of writing, Puppet 6.10.1)
```
$ pdk console --puppet-dev
pdk (WARN): Module fixtures not found, please run pdk bundle exec rake spec_prep.
[✔] Installing missing Gemfile dependencies.
Ruby Version: 2.4.7
Puppet Version: 6.10.1
Puppet Debugger Version: 0.15.1
Created by: NWOps <corey@nwops.io>
Type "commands" for a list of debugger commands
or "help" to show the help screen.

1:>>
```

Fixes puppetlabs#764
rodjek added a commit to rodjek/pdk that referenced this issue Oct 29, 2019
The original issue was that `pdk console --puppet-dev` didn't update the
checkout before using it. This is because the CLI for `pdk console`
didn't call `PDK::Util::PuppetVersion.fetch_puppet_dev`. Rather than add
that, I've opted to add this call to the logic in
`PDK::CLI::Util.puppet_from_opts_or_env` so that it happens
automatically when setting up the environment for puppet-dev.

---

First run to seed the checkout
```
$ pdk console --puppet-dev
pdk (WARN): Module fixtures not found, please run pdk bundle exec rake spec_prep.
[✔] Installing missing Gemfile dependencies.
Ruby Version: 2.4.7
Puppet Version: 6.10.1
Puppet Debugger Version: 0.15.1
Created by: NWOps <corey@nwops.io>
Type "commands" for a list of debugger commands
or "help" to show the help screen.

1:>>
```

Manually switch the checkout to Puppet 6.9.0
```
$ git -C ~/.pdk/cache/src/puppet checkout 6.9.0
Note: switching to '6.9.0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at c2ccdd4efe Merge pull request #7706 from gimmyxd/PUP-10016
```

Second run, showing that the checkout has been updated to the HEAD of
origin/master (at time of writing, Puppet 6.10.1)
```
$ pdk console --puppet-dev
pdk (WARN): Module fixtures not found, please run pdk bundle exec rake spec_prep.
[✔] Installing missing Gemfile dependencies.
Ruby Version: 2.4.7
Puppet Version: 6.10.1
Puppet Debugger Version: 0.15.1
Created by: NWOps <corey@nwops.io>
Type "commands" for a list of debugger commands
or "help" to show the help screen.

1:>>
```

Fixes puppetlabs#764
rodjek added a commit to rodjek/pdk that referenced this issue Oct 29, 2019
The original issue was that `pdk console --puppet-dev` didn't update the
checkout before using it. This is because the CLI for `pdk console`
didn't call `PDK::Util::PuppetVersion.fetch_puppet_dev`. Rather than add
that, I've opted to add this call to the logic in
`PDK::CLI::Util.puppet_from_opts_or_env` so that it happens
automatically when setting up the environment for puppet-dev.

---

First run to seed the checkout
```
$ pdk console --puppet-dev
pdk (WARN): Module fixtures not found, please run pdk bundle exec rake spec_prep.
[✔] Installing missing Gemfile dependencies.
Ruby Version: 2.4.7
Puppet Version: 6.10.1
Puppet Debugger Version: 0.15.1
Created by: NWOps <corey@nwops.io>
Type "commands" for a list of debugger commands
or "help" to show the help screen.

1:>>
```

Manually switch the checkout to Puppet 6.9.0
```
$ git -C ~/.pdk/cache/src/puppet checkout 6.9.0
Note: switching to '6.9.0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at c2ccdd4efe Merge pull request #7706 from gimmyxd/PUP-10016
```

Second run, showing that the checkout has been updated to the HEAD of
origin/master (at time of writing, Puppet 6.10.1)
```
$ pdk console --puppet-dev
pdk (WARN): Module fixtures not found, please run pdk bundle exec rake spec_prep.
[✔] Installing missing Gemfile dependencies.
Ruby Version: 2.4.7
Puppet Version: 6.10.1
Puppet Debugger Version: 0.15.1
Created by: NWOps <corey@nwops.io>
Type "commands" for a list of debugger commands
or "help" to show the help screen.

1:>>
```

Fixes puppetlabs#764
glennsarti added a commit that referenced this issue Oct 29, 2019
(#764) Ensure --puppet-dev checkout is always updated
@rodjek rodjek changed the title puppet-dev does not grab latest code pdk console --puppet-dev does not grab latest Puppet source Nov 1, 2019
logicminds pushed a commit to nwops/pdk that referenced this issue Nov 30, 2020
The original issue was that `pdk console --puppet-dev` didn't update the
checkout before using it. This is because the CLI for `pdk console`
didn't call `PDK::Util::PuppetVersion.fetch_puppet_dev`. Rather than add
that, I've opted to add this call to the logic in
`PDK::CLI::Util.puppet_from_opts_or_env` so that it happens
automatically when setting up the environment for puppet-dev.

---

First run to seed the checkout
```
$ pdk console --puppet-dev
pdk (WARN): Module fixtures not found, please run pdk bundle exec rake spec_prep.
[✔] Installing missing Gemfile dependencies.
Ruby Version: 2.4.7
Puppet Version: 6.10.1
Puppet Debugger Version: 0.15.1
Created by: NWOps <corey@nwops.io>
Type "commands" for a list of debugger commands
or "help" to show the help screen.

1:>>
```

Manually switch the checkout to Puppet 6.9.0
```
$ git -C ~/.pdk/cache/src/puppet checkout 6.9.0
Note: switching to '6.9.0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at c2ccdd4efe Merge pull request #7706 from gimmyxd/PUP-10016
```

Second run, showing that the checkout has been updated to the HEAD of
origin/master (at time of writing, Puppet 6.10.1)
```
$ pdk console --puppet-dev
pdk (WARN): Module fixtures not found, please run pdk bundle exec rake spec_prep.
[✔] Installing missing Gemfile dependencies.
Ruby Version: 2.4.7
Puppet Version: 6.10.1
Puppet Debugger Version: 0.15.1
Created by: NWOps <corey@nwops.io>
Type "commands" for a list of debugger commands
or "help" to show the help screen.

1:>>
```

Fixes puppetlabs#764
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 a pull request may close this issue.

3 participants