Skip to content

Remove "neo4j" short tags special case #2238

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

Merged
merged 1 commit into from
Nov 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions push.pl
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ sub prompt_for_edit {
$proposedText =~ s%$supportedTagsRegex%$sponsoredLinks$1$2%;
}

my $alwaysShortTags = ($proposedFile eq 'neo4j/README.md');

if ($alwaysShortTags || ($lengthLimit > 0 && length($proposedText) > $lengthLimit)) {
if ($lengthLimit > 0 && length($proposedText) > $lengthLimit) {
# TODO https://github.com/docker/hub-beta-feedback/issues/238
my $fullUrl = "$githubBase/$proposedFile";
my $shortTags = "-\tSee [\"Supported tags and respective \`Dockerfile\` links\" at $fullUrl]($fullUrl#supported-tags-and-respective-dockerfile-links)\n\n";
Expand All @@ -100,16 +98,12 @@ sub prompt_for_edit {
my $startingNote = $genericNote . "\n\n";
my $endingNote = "\n\n...\n\n" . $genericNote;

$tagsNote = $shortTags if $alwaysShortTags;

my $trimmedText = $proposedText;

# if our text is too long for the Hub length limit, let's first try removing the "Supported tags" list and add $tagsNote and see if that's enough to let us put the full image documentation
$trimmedText =~ s%$supportedTagsRegex%$sponsoredLinks$1$tagsNote%ms;
# (we scrape until the next "h1" or a line starting with a link which is likely a build status badge for an architecture-namespace)

$proposedText = $trimmedText if $alwaysShortTags;

if (length($trimmedText) > $lengthLimit) {
# ... if that doesn't do the trick, then do our older naïve description trimming
$trimmedText = $startingNote . substr $proposedText, 0, ($lengthLimit - length($startingNote . $endingNote));
Expand Down