pub.dartlang.org and Github webhooks

63 views
Skip to first unread message

Gonzalo Chumillas

unread,
Jun 22, 2016, 8:00:56 AM6/22/16
to Dart Misc
It would be nice to implement a mechanism to automatically update Dart packages from Github. Composer (a PHP package manager) already implement it:
https://packagist.org/

It pulls the packages from Github every time a new release (tag) is published. This will prevent the user to execute again and again the "pub publish" command. And also it will ensure that all packages are up-to-date.

That's my suggestion. Sorry for my basic English :)

Günter Zöchbauer

unread,
Jun 22, 2016, 11:30:37 AM6/22/16
to Dart Misc
What do you mean by automatically?
pub upgrade 
updates dependencies. I don't use git dependencies a lot. Is there any problem with it?

Kun Zhao

unread,
Jun 22, 2016, 11:59:10 AM6/22/16
to mi...@dartlang.org
You can change your pubspec.yaml file to a git url directly. 

"And also it will ensure that all packages are up-to-date."
That might be dangerous, if the new package has broken changes. 

--
For other discussions, see https://groups.google.com/a/dartlang.org/
 
For HOWTO questions, visit http://stackoverflow.com/tags/dart
 
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.

Gonzalo Chumillas

unread,
Jun 22, 2016, 12:22:57 PM6/22/16
to mi...@dartlang.org
What I mean is this: usually every project is stored in two repository managers. A dartlang repository manager:

and a GitHub repository manager:

If you want to upload or update your project to pub.dartlang.org, just change the version number (pubspec.yaml) and execute the following command:
> pub publish


If you want to upload/update your project to GitHub, just execute the following command:
> git push


There's something very interesting in GitHub called Webhooks. A 'webhooks' notifies to other services that the repository has changed. This way, we do not need to execute the "pub publish" command. Just "git push":

# push your project and notify pub.dartlang.org that something has changed
> git push


This is how packagist.org works. And it is great.

Bob Nystrom

unread,
Jun 22, 2016, 1:03:34 PM6/22/16
to General Dart Discussion

On Wed, Jun 22, 2016 at 5:00 AM, Gonzalo Chumillas <gonzalo....@gmail.com> wrote:
It pulls the packages from Github every time a new release (tag) is published. This will prevent the user to execute again and again the "pub publish" command. And also it will ensure that all packages are up-to-date.

Yeah, we've talked about this before. It would be handy.

It's a little hairy to implement because of authentication and stuff, which is partially why it's never bubbled up to be a high enough priority for us to do.

I think it would be possible to do it outside of pub itself, though. Some enterprising individual could probably build a little system that does all of this by invoking pub lish as needed after it sees a new tag has been pushed.

Cheers!

– bob


Don Olmstead

unread,
Jun 22, 2016, 2:47:07 PM6/22/16
to mi...@dartlang.org
A CI system should be able to handle this fine. I was planning on having a hookup with Drone that would publish a package if the pubspec.yaml version was updated. I did the same thing with NPM here at work. The issue with the Drone one is that these would be private packages so I've been waiting on https://github.com/dart-lang/pub/issues/1381 to really give it a go.

Reply all
Reply to author
Forward
0 new messages