#1201 initial Ansible Collection guidelines
Merged by james. Opened by gotmax23.
gotmax23/packaging-committee ansible-collections  into  master

Download 1201.patch

We've had Ansible collection packaging macros for two years now, so I figured it was time to write up some guidelines. This is marked as a draft, as I'm still soliciting feedback and tying up some loose ends:

Mainly, I'm thinking about removing the need for the %global collection_* boilerplate and having the macros read from the metadata, instead. For that to happen, %{ansible_collection_files} would need to be replaced with an approach that passes a file list to %files -f so it could be dynamically generated. This is a nice side effect, IMO, because this would align the ansible macros with other ecosystems.

To give credit where credit is due, @ignatenkobrain initially wrote these macros.

/cc @kevin @dmsimard @ngompa @ignatenkobrain

Excellent summary.

Typo for shebang ?

rebased onto c0b7667b17dadeb9ef298096b60910563ff238ec

Typo for shebang ?

Fixed.

Excellent summary.

Thanks :).

Since recently, Docs stylesheet automatically generates a table of contents.
There is no need to specify :toc: any more.

Is % prefix missing from ansible_collection_build and ansible_collection here?
Other macros in this document are written with that prefix,
and using it seems to be the standard way to do that also elsewhere.

In my opinion, this statement does not add anything here.
It goes without saying that tooling and Guidelines are subject to change and improvement.

In my opinion, this statement does not add anything here.
All packages must follow the rules for the License: field.
That does not have to be repeated for Ansible packages repeatedly.

Is %check missing from this example?

Disclaimer for all my comments above:
I am not a member of the Packaging Committee.
My review comments are completely unofficial.

rebased onto fc3bdf287aa2c8e71ca8abddc84657eadf949e06

Is % prefix missing from ansible_collection_build and ansible_collection here?
Other macros in this document are written with that prefix,
and using it seems to be the standard way to do that also elsewhere.

Fixed.

Is %check missing from this example?

Indeed, it is. I've fixed it.

In my opinion, this statement does not add anything here.
It goes without saying that tooling and Guidelines are subject to change and improvement.

I guess you kind of have a point. The idea was for packagers to be prepared for this to change in the future. I'm thinking that I might have this fixed before the "final draft," so I'll leave it here more as a reminder for now.

Since recently, Docs stylesheet automatically generates a table of contents.
There is no need to specify :toc: any more.

It adds a table of contents to the beginning of the page. Notice the difference between https://docs.fedoraproject.org/en-US/packaging-guidelines/CMake/ (has :toc:) and https://docs.fedoraproject.org/en-US/packaging-guidelines/JavaScript/ (does not).

In my opinion, this statement does not add anything here.
All packages must follow the rules for the License: field.
That does not have to be repeated for Ansible packages repeatedly.

I mainly added it here so the legal team didn't complain about there being legal guidelines within the packaging guidelines. I'll remove that if there's consensus to do so.

rebased onto f45c3518c71345192ebcfdfb660b5260ec4e732e

I've force pushed to add two newlines between specfile sections in the example.

2 new commits added

  • ansible example: Use patch file to edit metadata
  • Explicitly state that all collections can be packaged

3 new commits added

  • ansible example: Use patch file to edit metadata
  • Explicitly state that all collections can be packaged
  • Initial Ansible Collection guidelines

Since recently, Docs stylesheet automatically generates a table of contents.
There is no need to specify :toc: any more.

It adds a table of contents to the beginning of the page. Notice the difference between https://docs.fedoraproject.org/en-US/packaging-guidelines/CMake/ (has :toc:) and https://docs.fedoraproject.org/en-US/packaging-guidelines/JavaScript/ (does not).

That it does. My point was that even without it, there is a table of contents visible.
Either on the right, or on top, depending on viewport width.
And for narrow viewports, the automatic one is only visible if :toc: is not specified.

Anyhow, I just wanted to point out that :toc: is not needed to get a table of contents any more.
I am not aware of any style guide or such saying that you should not include it,
so please do if you prefer to do so.

rebased onto 275e6cf4988c9108cc645a9673f067eb24a51351

Metadata Update from @tibbs:
- Pull-request tagged with: meeting

Are these really named without the "ansible_" prefix? If so, the inconsistency seems a bit odd.

This caveat is interesting; now I wonder if one method is preferred. From a macro standpoint is it simpler to just stuff a list of files in a string than to write out a file (which probably needs Lua) and so having consistency across different sets of macros might be difficult if it's even something we wanted.

Yes; currently, %ansible_collection_install, %ansible_test_unit, and %ansible_collection_files rely on the %collection_namespace and %collection_name macros being set in the specfile. I am working on refactoring the macros to extract these values from the galaxy.yml metadata file and remove the need for these macros. This will require a file list.

From a macro standpoint is it simpler to just stuff a list of files in a string

That's true in some cases, but it won't work if you need to dynamically populate the %files section based on content from the extracted sources.

rebased onto 5fba15afc683951b2672f08017de6646e969bed5

@gotmax23:

I am working on refactoring the macros to extract these values from the galaxy.yml metadata file and remove the need for these macros. This will require a file list.

Okay, I have completed this refactoring. The changes are available here if anyone has comments on it before I merge. The refactoring removes the need for %collection_namespace and %collection_name. This guidelines PR reflects the macro changes.

1 new commit added

  • ansible: Clarify %ansible_collection_url guideline

10 new commits added

  • Fix wording and typos
  • ansible: Clarify %ansible_collection_url guideline
  • Add new Macro breakdown section
  • Update example specfile
  • ansible: Document %ansible_collection_filelist
  • ansible: Remove section about boilerplate
  • ansible: Expand Dependencies guidelines
  • ansible example: Use patch file to edit metadata
  • Explicitly state that all collections can be packaged
  • Initial Ansible Collection guidelines

10 new commits added

  • Fix wording and typos
  • ansible: Clarify %ansible_collection_url guideline
  • Add new Macro breakdown section
  • Update example specfile
  • ansible: Document %ansible_collection_filelist
  • ansible: Remove section about boilerplate
  • ansible: Expand Dependencies guidelines
  • ansible example: Use patch file to edit metadata
  • Explicitly state that all collections can be packaged
  • Initial Ansible Collection guidelines

10 new commits added

  • Fix wording and typos
  • ansible: Clarify %ansible_collection_url guideline
  • Add new Macro breakdown section
  • Update example specfile
  • ansible: Document %ansible_collection_filelist
  • ansible: Remove section about boilerplate
  • ansible: Expand Dependencies guidelines
  • ansible example: Use patch file to edit metadata
  • Explicitly state that all collections can be packaged
  • Initial Ansible Collection guidelines

1 new commit added

  • Move Ansible to Other Domain-specific Guidelines

11 new commits added

  • Move Ansible to Other Domain-specific Guidelines
  • ansible: Fix wording and typos
  • ansible: Clarify %ansible_collection_url guideline
  • ansible: Add new Macro breakdown section
  • ansible: Update example specfile
  • ansible: Document %ansible_collection_filelist
  • ansible: Remove section about boilerplate
  • ansible: Expand Dependencies guidelines
  • ansible example: Use patch file to edit metadata
  • Explicitly state that all collections can be packaged
  • Initial Ansible Collection guidelines

I'm removing the draft status. The ansible-packaging changes have been merged and the new version is now available in the buildroot, and I'm satisfied with the current state of the guideline text.

rebased onto 8edb6a4870a632cd037479b9650cd490d47a5fee

rebased onto 097a1a50c87c7616eae78ed47930cbdc0eca1b92

I've rebased this. What are the next steps here?

Commit 136e8f9e fixes this pull-request

Pull-Request has been merged by james

Pull-Request has been merged by james

Metadata