Skip to content

Add guide for tracking Source files in dist-git#1142

Open
majamassarini wants to merge 1 commit into
packit:mainfrom
majamassarini:track-source-in-vcs-2365
Open

Add guide for tracking Source files in dist-git#1142
majamassarini wants to merge 1 commit into
packit:mainfrom
majamassarini:track-source-in-vcs-2365

Conversation

@majamassarini
Copy link
Copy Markdown
Member

Add a how-to that shows how to use the post-modifications action (or pre-sync for URL-based sources) together with files_to_sync to keep small extra Source files in dist-git's VCS rather than uploading them to the lookaside cache on the first sync.

Link to the new guide from the existing note in the configuration index and from the actions reference.

Fixes packit/packit#2365

Assisted-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

@centosinfra-prod-github-app
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Member

@nforro nforro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little too verbose for my taste, but definitely better than nothing 🙂

Comment on lines +103 to +119
### Multiple files

For more than one file, list them in `files_to_sync` and stage them in a single
command. Using `git add -- <paths>` keeps the action robust against future
files that match dot-prefixes or unusual names:

```yaml
files_to_sync:
- pkg.spec
- pkg.service
- pkg.socket
- pkg.sysusers

actions:
post-modifications:
- bash -c 'cd "${PACKIT_DOWNSTREAM_REPO}" && git add -- pkg.service pkg.socket pkg.sysusers'
```
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this meant to discourage using git add * or git add .? If yes, I would state that explicitly, becuase otherwise this whole paragraph seems redundant - everything is practically the same as for a single file.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason why the agent added this example and it isn't using git add * is explained.

Using git add -- <paths> keeps the action robust against future
files that match dot-prefixes or unusual names:

  $ git add *               # so this misses .env
  $ git status -s .env
  ?? .env                   # still untracked
  $ git add -pkg.service
  unknown switch `p'
  usage: git add [<options>] [--] <pathspec>...

  $ git add -- -pkg.service     # works

These are really corner cases, so if you want I can remove this paragraph, but I think this is a useful tip.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a useful tip.

Exactly, so I would convert it to a tip admonition and shorten it to one ot two sentences (do not use git add . or git add *, use git add -- file1 file2 instead).


### `post-modifications`

This action runs in the release-synchronization workflow after the spec file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not true (or badly formulated), it runs in upstream jobs as well.

Copy link
Copy Markdown
Member Author

@majamassarini majamassarini May 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't read it as it runs only in release-synchronization. I read it as it runs after the specfile has been modified during the release-synchronization. 🤔 or I don't follow you.

Copy link
Copy Markdown
Member

@nforro nforro May 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's why I said badly formulated. You can read it both ways, let's use different wording.

Comment thread docs/configuration/actions.md Outdated
@centosinfra-prod-github-app
Copy link
Copy Markdown
Contributor

Add a how-to that shows how to use the post-modifications action (or
pre-sync for URL-based sources) together with files_to_sync to keep
small extra Source files in dist-git's VCS rather than uploading them
to the lookaside cache on the first sync.

Assisted-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Co-authored-by: Nikola Forró <nforro@redhat.com>
@majamassarini majamassarini force-pushed the track-source-in-vcs-2365 branch from 9aecd40 to eb87d98 Compare May 27, 2026 07:25
@centosinfra-prod-github-app
Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Adding a new Source file to be tracked via vcs instead of lookaside cache

3 participants