-
Notifications
You must be signed in to change notification settings - Fork 95
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
Handling of repo-level README.md #6
Comments
I'm drafting copier-org/copier#260 but it's not ready yet. But indeed it's my planned main next enhancement. It's sad that there's no interactive support for multiline answers, but currently there's a workaround: multiline_answer='this is
my multiline answer'
copier -d "multiline_question=$multiline_answer" [...] I hope that unblocks you for the time being. |
@sbidoul There is already automation to generate the addons table in the repo README. |
I think copier is a better candidate here, since you're not changing descriptions all the time. But yes, it's an option. |
@yajo I have difficulties using What I'm trying to do is this, as it is what we'd expect PSC to do to update their README:
But README.md stays unchanched. I'm using copier 5.1. |
Well, this is not working for several reasons, but don't worry. Let me teach you a bit how Copier works. First of all, go read https://copier.readthedocs.io/en/latest/updating/ carefully (these docs are from master, which have improved recently this specific part). So, the 1st problem:
For Before you ask, there is support for prereleases, so when planning a new release, let's say v1.0.0, if we want to test, it's as simple as publishing an alpha release named v1.0.0a0 (for example). This will make downstream users of the template ignore this tag, unless explicitly passed I can publish the 1st alpha now if you want. Second problem:
This is not how copier works. Copier expects that a given set of answers (which include user-provided answers and copier stuff like The process to update answers is to use copier itself. Example: copier --data project_description='My new description.' I thought it was explained here, but I'll explain it better for the wider audience (see #11) that doesn't know Copier very well:
As you probably have guessed by now, this assumption should change a bit:
A possible workflow would be:
Another possible workflow would be the same as the above, but skipping steps 1 and 2, and going directly to a scheduled update like outlined in step 3. After all, it should produce no diff if the template version is the same. |
This should help PSCs that have wrong expectations about how Copier works to avoid update problems, as seen in OCA#6.
This should help PSCs that have wrong expectations about how Copier works to avoid update problems, as seen in #6.
Thanks for the explanation, @yajo it was much needed apparently. And I did RTFM. I'm not sure my issues are related to the absence of tags in the template as what I was trying to do is mainly update the README without changing the template.
So where are we going to get |
Happy to help!
Well, you can get it from there. You just don't write it there. You tell copier the new answer, and then Copier will write it there, at the same time as it updates the README. |
I don't understand. I'm going to generate the 14.0 branches with basically empty README.md. Then we need to ask PSCs to put their title and description somewhere to update the README.md. How do we do that? |
And if we need another place than |
@yajo Or do you think we can simply let users modify README.md and let In that case, maybe we should remove the questions for the title and description, and put comments to mark the sections that the user should not change manually? But then would remain the problem of preserving the README content across Odoo series. |
We'll see how to address that next year. For now let's go with what we have here, i.e. letting PSC update README.md manually and |
I explained that above in #6 (comment), but let me explain again differently. Imagine this _commit: v1.0.0
_src_path: https://github.com/OCA/oca-addons-repo-template.git
description: This is my nice description Then, imagine this template # Sample README
{{ description }} It would produce this # Sample README
This is my nice description OK, up until now all is well understood, right? Now, imagine you go and edit -description: This is my nice description
+description: Updated description And then Now, you run 🤖 💭 OK, so when the user answered # Sample README
This is my nice description 🤖 💭 Then, what would result with current answers? Let me check... Well, current answer is also # Sample README
This is my nice description See? You tricked Copier and shot yourself in the foot. 🦶 🔫 The correct process is: You still have this original Imagine this _commit: v1.0.0
_src_path: https://github.com/OCA/oca-addons-repo-template.git
description: This is my nice description Then you ask copier to update the template with different answers: copier --data description='Updated description' update Then Copier thinks: 🤖 💭 OK, so when the user answered # Sample README
This is my nice description 🤖 💭 Then, what would result with current answers? Let me check... The current answer has changed to # Sample README
Updated description Everyone's happy. 😊 |
Oh I forgot this part. #12 is not wrong per se, it's just another approach that will work perfectly. However, indeed, it would be better to include a new question in the form instead of relying on manual modifications because of this detail. Just remember: never edit |
When this project was initialized back in May,
copier
did not support rich text answers. So the description field inREADME.md
was limited to a single line. Some repo currently have richer descriptions (bullet points, links).On the other hand, managing
README.md
via the template has huge benefits in terms of harmonizing the files across repo and facilitating updates.@yajo do you know if copier now support multiline text answers?
Irrespective of the answer, I'm currently leaning towards creating fresh README.md from the template for the 14.0 branch, and then let PSC update the answers file to provide the content.
What do people think?
The text was updated successfully, but these errors were encountered: