pyinfra-dev / pyinfra-dev/pyinfra

Add `files.patch` operation

Open
#877 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

operations
Dominant language
Python
Stars
6k
Forks
548
Avg merge
7d 17h
Merged PRs (30d)
13

Description

Is your feature request related to a problem? Please describe

Some files, I need to change in various places, and its way easier to just diff original modified.

Describe the solution you'd like

I have done a script that patches the files and silently continue if they are already patched.

Could a new feature allow to apply a patch in a idempotent way and also pyinfra have information about it (for example, the "No changes" or the "Success" information)?

Example:
A function .patch( name="Patch this configuration file",
src="patches/example.patch",
destination="/etc/example.conf" )

Thanks !

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing existing pyinfra operation implementations and their change-reporting conventions, then trace how an operation receives a source patch and destination path. Compare the requested idempotent behavior with existing operation tests and define completion around applying an unapplied patch while reporting either changes or no changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.