-
Notifications
You must be signed in to change notification settings - Fork 152
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
Add a check for volatile source-urls #512
Conversation
Volatile `source-url`s will result in an inconsistent module state the users computer as soon as the contents of that source-url change without a matching change in the version number. Setting `source-url` to a git master branch is the typical faux-pas. *Instead* one should change the `source-url`to link to a never changing target (a tag, revision or some zip file).
Can we have a test for this? I am somehow sure this template is not read most of the time just like a lot of other texts now. UPD: never mind the test, I think about 99.9% of our modules will fail it anyway. Ouch. |
@Altai-man I actually plan to also add a Travis configuration to check for evil source-urls. JJ is working on the docs - see Raku/doc#3481. I do understand that we can't forbid people to do one thing without telling them how else to do it. So maybe this PR needs to be held back before that doc issue is solved. |
Oh, yes, I think the intention is right. But we have some serious re-education to do... |
@ugexe mentioned a few in the comments to the problem-solving repo; Ddt would be one of them. The question is not only the change of source URL, it's also that you need to add to here every time you release a new version. So we badly need an education campaign. |
Ddt looks fine on first sight, but is actually broken just as the others, all of the linked META files still have a Also I think we need some tool to automate the insertion of the META files into the ecosystem based on changes in the repo. Reasoning: When the best we can come up with is a guide that instructs users to manually create a PR to the ecosystem repo for each new version, then from a usability perspective this is similarly cumbersome as releasing on CPAN. Also the number of PRs to the ecosystem repo wil increase by some factors if we still want to go with PRs. How could such a tool access the ecosystem repo? Should it just create PRs that are still manually reviewed and merged? Should there be a bot account that just directly commits stuff? |
The thing is, I'm not sure changing the template is the best first step. Going back to the roadmap idea, it should rather be the last... |
In the grand scheme of things I'd still expect some sort of bleading-edge ecosystem, and that is essentially how p6c functions (even if that is not how people understand it). I'm not saying it couldn't be a different ecosystem, just that its current behavior does actually serve a purpose. If you wanted to make it easy for newcomers I'd probably require them to add some github hook such that automation would be notified of new github releases, but having a command line tool to automatically do everything after minimal user interaction would seem fairly user friendly as well. There is the technique of just scanning their repos for diffs in their META6.json version line and recording the commit, but I have always viewed that as a hacky way to demonstrate ecosystem automation MvP (I'd not promote it over the previously mentioned methods). The one issue with automatic releases that I'm wary of is the size of the index (an inevitable problem regardless, but exacerbated by automation). We need a more performant way to make all the meta data necessary for the internal recommendation manager to decide what some long name references (including the ability to understand NYI S22 bits like emulates, so not just providing provides/api/auth/version). Presumably that format also needs a way to link to a secondary file with all the json (maybe via an offset recorded in the index) so we can also get at large (but usually not needed) things like the description for e.g. |
I think I (we?) need to work out which role p6c should play. What use case do we want it to solve? In my opinion the primary strengths of p6c and CPAN are ease of use and robustness respectively. To a limited extent I see value in both ecosystems. Creating a CPAN release of an average Raku library usually requires initial setup (to create a PAUSE account) and a single command given a respective tool like In my opinion every ecosystem that is readily available for public consumption should be reliable. So I think modules that are meant for normal public use and modules that are depended on by other modules absolutely must always have stable @ugexe You mentioned the phrase "bleading-edge ecosystem". Can you elaborate what a use case and usage pattern you envision in that respect? Maybe that provides a more valuable role for p6c to play. |
@ugexe Did you notice my above question? |
Someone can keep pushing their
What is more important is that every default ecosystem is reliable. If we could make
There is already user interaction -- the user has to add their module to META.list. I am saying one option is to remove that step and instead have them setup the hook (presuming a hook can even be used to do what we need).
But its not just an ecosystem thing -- if users aren't doing While I've mentioned possibly making automatic releases by scanning git-repos, I've also not convinced myself that this would be reliable in the sense CPAN is (i.e. some script that will evolve and change over time will be acting as the authority of when some version is exposed to the public as an immutable version). I'm not saying its a bad idea either though. |
@ugexe Thanks for your comments!
I'm struggling to understand. Do you mean: "P6C is not meant to be used for official releases. That people do that anyways is sad, but not central to this discussion." ? (If that's what you mean, then what is p6c meant to be used for? - That's basically my last question at the bottom.)
I think we agree and actually mean the same thing here.
One command for a release isn't bad. But if we aim for the one-command-per-release solution, then I think the best way forward is to deprecate p6c and push people to release on CPAN instead.
I don't yet understand what concept you have in mind when you mentioned "bleading-edge ecosystem". Can you elaborate on that? Maybe the best way forward is to force people to release on CPAN by default and have p6c serve a different purpose. That's why I'm interested in your thoughts on such a different purpose. |
The version absolutely must be bumped every release -- this cannot be avoided. So maybe not a CLI command, but the user has to do something specifically to say 'ahem new version'. A naive solution might just bump the minor version every commit automatically (assuming the distribution is even using semver), but that not reliable because its going to end up mis-versioning major version changes. The nice thing about the git hook solution is the hook presumably passes along the version the user explicitly declared has just been created.
Know how you can add |
@ugexe The bleading-edge ecosystem idea sounds interesting. If we want to go down that road the following milestones come to mind:
I imagine the use of p6c for final / real releases to drop significantly after we are done with point 2. Point 3. and 4. are then lower priority, because people will start using CPAN for real releases instead. The above is only an idea. I'd like to have some feedback on this. We need to have consensus on how we want to move forward with p6c in general before anything can move forward. |
Don't forget that many authors, including some core devs, don't want to use CPAN and prefer the github model. Enforcing the Perl CPAN may result in the opposite of what you want to achieve. |
@nxadm Can you elaborate on the "don't want to use CPAN and prefer the github model" bit? I'm interested in the reasons so they can be addressed. This is especially interesting as there currently is only a single distribution I'm aware of that uses p6c in a safe way. It's |
Just my 2 cents: when I asked folks how do I get an account to use CPAN I was replied with something like "So you e-mail to some folk and after a week or two they maybe reply you back", which sounded 1993 to me and I dropped this idea. For the sake of an example, I (as an example of the user who did not use CPAN nor had other related experience) will now proceed with trying to get an account to work with CPAN, writing down below what I am seeing... 1)Google "how to get cpan account" Just to be clear: I do not want to offend anyone. But clear issues I see with CPAN usage for Raku are: 1)Perl everywhere. For the record, I do not want to look like a pretentious kid who needs at least 5 megabytes of javascript to consider a website cool and who does not respect awesome universal solutions like simple web pages, doesn't like to read a lot of text and such. But even so I found mere account registration process, which should be dead simple, not so simple, and I am scared to think how many pages should I read to get to know how to upload my module. Even if there is a single command to do so, as an example of a user outside of Perl community, after the steps above I don't have a lot of desire to look it up. It should be simpler to share useful code. |
I see the importance and usefulness of CPAN for Perl. It's has been there for decades, it works very well and is 100% identified with Perl. CPAN is Perl and Perl is CPAN. Even ignoring the terrible error of running user-visible Raku infra on something that's clearly Perl-centric after the rename and the announcement of Perl 7, I fail to see the point of CPAN for Raku. It's 2020 and we live in a world with free and/org self hosted repos (github, gitlab and gitea) and zillions of CI solutions. The CPAN flow feels like reinventing the wheel like it was 2000. 2c and all. |
@Altai-man I agree. So deriving some actionables from your observations:
@nxadm I do see value in CPAN in contrast to a repo based approach. Mostly because of it's reliability and single point of authority. p6c currently does not provide a similarly reliable service. p6c is inherently decentral, modules can be located anywhere and no guarantees can be given that they don't disappear or change. We could reimplement our own module data-store. But that is coupled to our own hardware and software infrastructure which costs money and needs to be maintained. I think the worst part about CPAN is that we need to cooperate with people outside our Raku bubble. But I don't mind doing that much. Should this discussion be taken over to problem-solving? |
Now that a new indexer is in development that is meant to work with volatile source URLs and where they make a lot of sense (the zef-p6c ecosystem) we should not proceed with this PR. Closing. |
I know of one single module that actually meets the requirement (Inline::Perl5). I'm not sure there are any others. So if this change actually reflects a best practice, then the current state of the ecosystem is grave.
So I'd like to have some feedback if this change actually is a best practice. - Or if I still don't understand how the ecosystem works and just missed the point again.
Volatile
source-url
s will result in an inconsistent module state the users computer as soon as the contents of that source-url change without a matching change in the version number. Settingsource-url
to a git master branch is the typical faux-pas.Instead one should change the
source-url
to link to a never changing target (a tag, revision or some zip file).Related to Raku/problem-solving#72.
@niner @ugexe @JJ