Skip to content
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

Updated changelogs to link to the related issue. #6740

Closed
wants to merge 1 commit into from

Conversation

suralc
Copy link
Contributor

@suralc suralc commented Jan 3, 2015

This update should make the changelogs easier to handle from the github interface as no more copy+paste is required to read into specifics of an issue.

News entries on the homepage link to github, so it will always be rendered fine. This could probably be automated in the release process but also eases use of those logs while developing.

Script used. The regex should only match issues that are not yet linkified so running this multiple times should be fine.:

$changelogs = array_merge(['./framework/CHANGELOG.md'], glob('./extensions/*/CHANGELOG.md'));
$baseUrl = 'https://github.com/yiisoft/yii2/issues/';

foreach($changelogs as $log) {
    $content = file_get_contents($log);
    $content = preg_replace_callback('/(?P<issue>(?<!\\[)#[\\d]{1,4}(?<!\\]))/m', function($match) use ($baseUrl) {
        $issueNumber = trim(trim($match['issue'], '#'));
        return '[' . trim($match['issue']) . '](' . $baseUrl . urlencode($issueNumber) . ')';
    }, $content, -1, $count);
    file_put_contents($log, $content);
    echo 'Updated', $log, ' ', $count, ' occurences updated', PHP_EOL;
}

@lynicidn
Copy link
Contributor

lynicidn commented Jan 3, 2015

это не нужно все таск менегеры умеют читать #6733

@suralc
Copy link
Contributor Author

suralc commented Jan 3, 2015

@lynicidn I don't know how the other issue, your comment and this issue relate. I only brought up the idea of adding this to the release task (build/controllers/ReleaseController.php) to allow a quick automated fix if this change is desirable and someone adds a line without a link.

The links I added on the other issue are just to point out that the syntax is still valid on newer versions of phpdoc and the related standart proposal.

@qiangxue
Copy link
Member

qiangxue commented Jan 4, 2015

With these links, the raw changelog file is very cluttered. I think its' better we develop a changelog viewer that adds links dynamically.

@qiangxue qiangxue closed this Jan 4, 2015
@qiangxue qiangxue reopened this Jan 4, 2015
@suralc
Copy link
Contributor Author

suralc commented Jan 4, 2015

Right, I only checked the last news entry which linked to the rendered file on github and most people around here don't use markdown as a plain text format, but default to opening it with some editor that can render it. That's probably not true for all environments, even if the linked version isn't that unreadable without an editor (as long one doesn't reads it on a shell).

Anyway, @qiangxue shall I close the pr or should it stay open, as you reopened it?

@qiangxue
Copy link
Member

qiangxue commented Jan 4, 2015

Let's keep it open. We will develop a changelog viewer in the new project site and may use your script here.

@qiangxue qiangxue added this to the website and infrastructure milestone Jan 4, 2015
@klimov-paul
Copy link
Member

After we extracted extensions into the separated repository this PR lost it sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants