Git Product home page Git Product logo

mint-tag's People

Contributors

duk3luk3 avatar lerlacher-fm avatar mmcclimon avatar rjbs avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mint-tag's Issues

consider dropping Maybe[]

# If this is here, it's the name of a group/organization that we trust; if our
# label was added by someone not in this group, we'll reject it.
has trusted_org => (
is => 'ro',
isa => Maybe[Str],
);

Can we drop the Maybe[]? You said it might've been added because of some kind of type system carping. If we can ditch them, all the better. Maybe[] is usually wrong compared to just leaving things unset.

consider version in line zero

mint-tag/lib/App/MintTag.pm

Lines 213 to 217 in 4296078

my $msg = sprintf(
"mint-tag generated commit from step named %s\n\n%s",
$this_step->name,
$artifact->as_toml,
);

This is fine, but I will restate my original advice, which are you free to discount, and I will not be bothered. :)

I said "be sure to put the version as the very first thing" which might be, say:

v19 tag from tag-minter where blah blah

[[...]]
pie = eaten

…because you'd always be able to parse that no matter what. "Every tag starts with v then a string of digits, then a space." You seem to have put it into the TOML, meaning that for all time, every tag is described in TOML.

Probably this is fine, and I just want to know you decided knowing what I had meant!

most efficient way to get PRs from GtiHub

# Github does not allow you to get pull requests by label directly, so we
# need to make one to fetch everything with the label we want, and then a
# bunch of others to get the PRs themselves. (This sure would be easier if
# it were JMAP!)
my $issues = $self->http_get($self->uri_for('/issues', {
labels => $label,
sort => 'created',
direction => 'asc',
}));

I think that in fact you may want to use the /repos/:owner/:repo/pulls API end point, which has a ?state=open parameter. This returns full pull requests, so the big question is whether you're better off:

  1. fetching the list of issues with this label
  2. performing N fetches, one per issue with PR

or

  1. fetching all open PRs, filtering client-side by label
  2. …and possibly performing more than one fetch, because of pagination

Page size can be set to 100, which seems likely to always be more than enough, reducing the query count from 1+N to 1.

consider using a shared connection cache

my $ua = LWP::UserAgent->new;
$ua->default_header(Authorization => "token $token");
$ua->default_header(Accept => "application/vnd.github.v3+json");

Thrown out as an idea for the future, largely: if you have several remote at the same service, you may end up with more distinct TCP connections than required. You should be able to provide them all with a shared-across-the-app LWP::ConnCache to minimize this.

compute next mint-tag s.n. schneller

mint-tag/lib/App/MintTag.pm

Lines 193 to 200 in 4296078

for (my $n = 1; $n < 1000; $n++) {
my $candidate = sprintf '%03d', $n;
$tag = "$prefix-$ymd.$candidate";
# Do a prefix match, because we're going to add the sha at the end.
my $found_tags = run_git('tag', '-l', "$tag*");
last unless $found_tags;
}

I think you're probably better off getting a prefix match first, up to and excluding the s.n., then picking the next s.n. available. It'll run git-tag once instead of N times, and have the same number of races. No?

why does approver exist instead of return?

if ($self->interactive) {
# exits on lack of user confirmation
my $approver = App::MintTag::Approver->new($self->config);
$approver->confirm_plan;
}

Seems strange to me to let the approver exit, instead of just letting it signal approval. Then the caller can do the right thing. Minor, but we're usually well served to keep things like "exit" near the top level if we can.

Missing committer name config causes surprising error

Made my first mint-tag config today. I left out meta.committer_name and meta.committer_email because I was just fiddling locally. Later, calamity!

mint-tag | build-mysql-8: octopus merging 5 MRs
mint-tag | build-mysql-8: run: git merge --no-ff --no-commit 3aa343d8076dae8433b43cbf3ae079d8b6a52a3e 52480f1b105f95cf1c484296d19a7f15b50baadc 4acb6a3a8ca1ca3540a99ab0288f08e01c7629dc 29d4460d33e069d6e1535fd109f1d5be52d75514 c0649bd3b34f163fbe8c9b150ac53995b1cc2cf9
mint-tag | build-mysql-8: (git): fatal: empty ident name (for <>) not allowed

This is obviously easily fixed, and I did, but it took a moment to make the connection.

Suggest either saying "you must have these config values", or, taking the local git defaults.

Consider: be much noisier on failed merge

That is, we will exit immediately, leaving the working directory in a state of disarray. I think that's useful, because maybe you want to go in and see what's up. But we should be loud about doing so (red text), because it's possible you'll be in the middle of a rebase, or in a detached HEAD, or some other weirdness.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.