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

solution for specfile not in upstream #312

Open
lachmanfrantisek opened this issue May 8, 2019 · 19 comments

Comments

Projects
None yet
4 participants
@lachmanfrantisek
Copy link
Contributor

commented May 8, 2019

Some projects do not want to have a spec file in the upstream project.

Now, we have the following solutions:

  • Create a sourcegit with the one commit containing the spec file. (needs manual sync from upstream to sourcegit.)
  • Generate or download the spec file in the post-upstream-clone hook.

What about:

  • Adding a new option (specfile_url) to the config for this situation.
  • Adding support for URL to the specfile_path option.
@TomasTomecek

This comment has been minimized.

Copy link
Contributor

commented May 8, 2019

+1 specfile_url

the thing here is that some projects have more sources than just a spec file: for such use case, I'd suggest using the post-upstream-clone hook

@phracek

This comment has been minimized.

Copy link
Contributor

commented May 16, 2019

@lachmanfrantisek You mean like:

specfile_path: colin.spec
specfile_url: <SOME_URL>
synced_files:
  - colin.spec
  - .packit.yaml
upstream_project_name: colin
downstream_package_name: colin
@lachmanfrantisek

This comment has been minimized.

Copy link
Contributor Author

commented May 16, 2019

@lachmanfrantisek You mean like:

Yes, we can:

  1. Download <SOME_URL> to colin.spec
  2. Copy upstream/colin.spec to downstream/colin.spec on sync

How to handle downstream-to-upstream? In this case, you do not want to sync the spec file.

@TomasTomecek TomasTomecek added the docs label May 17, 2019

@TomasTomecek TomasTomecek added this to the 0.5.0 milestone May 17, 2019

@TomasTomecek

This comment has been minimized.

Copy link
Contributor

commented May 17, 2019

@lachmanfrantisek You mean like:

Yes, we can:

1. Download <SOME_URL> to `colin.spec`

2. Copy `upstream/colin.spec` to `downstream/colin.spec` on sync

This sounds like a ton of magic. Let's discuss in person so all of us are clear on the design.

How to handle downstream-to-upstream? In this case, you do not want to sync the spec file.

Because there is nowhere to sync it. Packit should quit and tell the user that the spec file is remote.

This also means that both specfile_* opts will be optional and only one needs to be set.

@phracek

This comment has been minimized.

Copy link
Contributor

commented May 24, 2019

My approach is to have it keep simple, like.

  1. propose-update - if syncfile_url is present, then download it and sync to downstream.
  2. sync-from-downstream - if syncfile_url is present, then just skip it. I would inform the user that all was synced except SPEC file because it is remote.

But post_upstream_hook seems to be good. Let's, user download remote SPEC file by curl command or similar. But in sync-from-downstream case, this could be a bit tricky.

@phracek

This comment has been minimized.

Copy link
Contributor

commented May 24, 2019

+1 specfile_url

the thing here is that some projects have more sources than just a spec file: for such use case, I'd suggest using the post-upstream-clone hook

What kind of resources do you mean? Any example? Just for my understanding:)

@TomasTomecek

This comment has been minimized.

Copy link
Contributor

commented May 24, 2019

@phracek

This comment has been minimized.

Copy link
Contributor

commented May 27, 2019

I see. I would split it into two tasks. First one will bring syncfile_url option into packit.yaml file and work with this variable in packit and second one will handle SourceXY files.

@TomasTomecek

This comment has been minimized.

Copy link
Contributor

commented May 27, 2019

please elaborate: show how the config would look

@hroncok

This comment has been minimized.

Copy link

commented Jun 4, 2019

Just a quick note after @phracek's presentation about Packit at today's Fedora 30 Release Party: I'd like to have the spec file and packit config file downstream only. I like upstream-downstream separation of concerns.

@TomasTomecek

This comment has been minimized.

Copy link
Contributor

commented Jun 6, 2019

The easiest solution here is to:

  1. dont have spec file upstream
  2. have an action which would download the spec file from a remote place
  3. packit would be then able to work with such project

+ document this

@hroncok

This comment has been minimized.

Copy link

commented Jun 6, 2019

download the spec file from a remote place

What if I only have spec file in Fedora dist-git? Why does packit need to download it at all?

@TomasTomecek

This comment has been minimized.

Copy link
Contributor

commented Jun 6, 2019

how do you create a srpm without spec file?

@hroncok

This comment has been minimized.

Copy link

commented Jun 6, 2019

From the downstream spec file?

@TomasTomecek

This comment has been minimized.

Copy link
Contributor

commented Jun 6, 2019

But you need to download it first before you can start using it: that's what we are trying to figure out here.

@hroncok

This comment has been minimized.

Copy link

commented Jun 6, 2019

Then I understood it wrong, ignore me.

@TomasTomecek

This comment has been minimized.

Copy link
Contributor

commented Jun 7, 2019

@hroncok no worries, that's our fault that we haven't explained the issue more clearly; I hope to work on this next week, hopefully we can discuss further then.

@phracek

This comment has been minimized.

Copy link
Contributor

commented Jul 18, 2019

It depends on the approach.

  • if we are focusing only for Fedora, then we can add a new option into packit.yaml configuration file like specfile_downstream=True which will always reference to downstream repository. In current configuration file we have defined downstream_package_name. The Patches and Sources can be downloaded by ogr.

e.g. VIM specfile is stored here: https://src.fedoraproject.org/rpms/vim/raw/master/f/vim.spec
With the help of rebase-helper, we can get all Patches and Sources and download them and we know full path to Fedora dist-git repo. All Sources and Patches are placed under the same directory.

  • if we allow also different URLs, then Fedora dist-git, it will be downloaded. Next action would be with the rebase-helper get all Sources and Patches and download them too. It should follow the same directory tree like in Fedora dist-git structures.

@lachmanfrantisek @TomasTomecek @jpopelka @rpitonak

@TomasTomecek

This comment has been minimized.

Copy link
Contributor

commented Jul 19, 2019

I'd personally pick the easiest way and try to do this in a way Franta describes in his original post:

Generate or download the spec file in the post-upstream-clone hook.

If that's too complicated, it would make sense to have an integrated solution in packit. If the "download in hook" solution is easy enough (just a bunch of curl calls?), I'd just have a documentation entry for it.

My $0.02, let's discuss further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.