question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update fails on new files

See original GitHub issue

Summary: When adding a new file to an already existing template, the new file is not added to an instance of the template upon update.

Im running cruft==2.5.0 here.

Step to reproduce:

  • Have an existing template and an instance of that template.
  • Add a new file to the template.
  • Run cruft update.

Current behaviour:

  • cruft check correctly detects the instance needs to be updated.
    $ cruft check
    FAILURE: Project's cruft is out of date! Run `cruft update` to clean this mess up.
    
  • cruft update asks me to review a diff, but when asked to show it, it reports “no changes”.
  • If I apply it, it reports success, but the new file has not been added.
    $ cruft update
    Respond with "s" to intentionally skip the update while marking your project as up-to-date or respond with "v" to view the changes that   will be applied.
    Apply diff and update? (y, n, s, v) [y]: v
    There are no changes.
    Respond with "s" to intentionally skip the update while marking your project as up-to-date or respond with "v" to view the changes that   will be applied.
    Apply diff and update? (y, n, s, v) [y]: y
    Good work! Project's cruft has been updated and is as clean as possible!
    

Expected behaviour of cruft update:

  • There is a meaningful diff shown for newly added files.
  • If I accept it, the new files is created.
  • Cruft should not report success if some change could not be handled correctly.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
peldszuscommented, Nov 9, 2020

Hi @samj1912!

Indeed, this was a regression, adding new files was working in 2.4.0 already. (But moving files #53 was already an issue in that version.) It is good that both are now fixed.

I see how the originally intended use of _get_deleted_files actually solves our problem. And our solution for #53 looks exactly like yours. 👍

I guess what we can learn here is that even having 100% line coverage in tests doesn’t protect us from having desired functionally still left untested. 😬

Anyway, thanks for providing the fix and the release! We’ll start using cruft now more often. 🙂

0reactions
peldszuscommented, Nov 24, 2020

This is already fixed and released in 2.6.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 Ways to Fix Some Update Files are Missing or Have Problems
The Some update files are missing error is usually due to a corrupted Windows update cache. Windows Update cannot correctly apply available ...
Read more >
Some update files are missing or have problems. We'll try to ...
Try running that first. 2) If that fails try manually resetting Windows Update Service: Open administrative Command Prompt and type following ...
Read more >
How to Fix the "Update Files are Missing" Error 0x80070003 ...
How to Fix the "Update Files are Missing" Error 0x80070003 on Windows · 1. Delete the Contents of the DataStore Folder · 2....
Read more >
Error "Move new files in place" when update #133 - GitHub
Hello, i'm update my installation of nextcloud with the web updater and i've this error ... Error "Move new files in place" when...
Read more >
7 Ways To Fix Windows Update Errors If They Failed - Action1
There are several reasons why Windows updates keep failing: Corrupt Update Files. In this case, try deleting the flawed file and see if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found