Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 14, 2025

This PR adds a new hiddenAuthor configuration option that allows users to display commit author names in their changelogs. This addresses the issue where users wanted to add author information but couldn't find any option to do so.

Changes Made

Configuration (src/Configuration.php)

  • Added hiddenAuthor property (default: true for backward compatibility)
  • Added isHiddenAuthor() and setHiddenAuthor() methods
  • Integrated into configuration array handling

Rendering (src/Changelog.php)

  • Modified changelog rendering to include author information when enabled
  • Authors displayed in italics: *by Author Name*
  • Multiple authors are de-duplicated and comma-separated

Documentation (docs/config.md)

  • Added hiddenAuthor to configuration options list
  • Updated default settings example
  • Added dedicated example showing how to enable the feature

Tests (tests/ChangelogTest.php)

  • Added tests for default behavior and configuration changes
  • All tests passing (9 tests, 26 assertions)
  • Successfully integrated with existing tests including Azure DevOps functionality

Usage

<?php
return [
    'hiddenAuthor' => false,  // Show author names in changelog
];

Output Example

Without authors (default):

* Add new feature ([abc123](https://github.com/user/repo/commit/abc123))

With authors:

* Add new feature ([abc123](https://github.com/user/repo/commit/abc123)) *by John Doe*

Technical Details

  • Default: true (hidden) - maintains backward compatibility
  • Data source: Uses existing Commit::getAuthorName() method
  • Position: Author appears after hash, before mentions
  • Format: Italic text with "by" prefix
  • Code stats: 4 files changed, 67 insertions, 1 deletion
  • Rebased: Successfully rebased on latest main branch with all conflicts resolved

Benefits

✅ Contributors get recognition for their work
✅ Team visibility and contribution tracking
✅ Backward compatible (disabled by default)
✅ Minimal code changes
✅ Follows existing patterns for similar options

Fixes #78

Original prompt

This section details on the original issue you should resolve

<issue_title>Author</issue_title>
<issue_description>Is there a way to add the author of the commit? Looking at the docs, I didn't find any option</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #78


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@marcocesarato
Copy link
Owner

@copilot finish tasks and resolve conflitcs

Copy link
Contributor Author

Copilot AI commented Oct 14, 2025

@copilot finish tasks and resolve conflitcs

✅ Tasks completed and conflicts resolved!

Changes:

  • Resolved merge conflicts with main branch (Azure DevOps tests)
  • Successfully rebased on latest main branch (commit 19e49d0)
  • All 9 tests passing (26 assertions)
  • Code style compliant

The branch is now up-to-date with main and ready for review.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/BrainMaestro/composer-git-hooks/zipball/ffed8803690ac12214082120eee3441b00aa390e
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/doctrine/lexer/zipball/84a527db05647743d50373e0ec53a152f2cde568
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/php-mock/php-mock-integration/zipball/04f4a8d5442ca457b102b5204673f77323e3edb5
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/php-mock/php-mock-phpunit/zipball/dc4cf8896bf47647080dc5709a2c67ee9d437c21
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/sebastianbergmann/phpunit/zipball/86e761949019ae83f49240b2f2123fb5ab3b2fc5
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/console/zipball/ea59bb0edfaf9f28d18d8791410ee0355f317669
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ad3b6f1e4e2da5690fefe075cd53a238646d8dd
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/event-dispatcher/zipball/404b307de426c1c488e5afad64403e5f145e82a5
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/filesystem/zipball/82b6c62b959f642d000456f08c6d219d749215b3
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/finder/zipball/20808dc6631aecafbe67c186af5dcb370be3a0eb
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/options-resolver/zipball/aa0e85b53bbb2b4951960efd61d295907eacd629
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/process/zipball/680e8a2ea6b3f87aecc07a6a65a203ae573d1902
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/service-contracts/zipball/a8c9cedf55f314f3a186041d19537303766df09a
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/stopwatch/zipball/f3adc98c1061875dd2edcd45e5b04e63d0e29f8f
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/string/zipball/823f143370880efcbdfa2dbca946b3358c4707e5
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/BuLC88 /usr/bin/composer install --no-interaction (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@Copilot Copilot AI changed the title [WIP] Add option to include commit author Add option to include commit author Oct 14, 2025
Copilot finished work on behalf of marcocesarato October 14, 2025 19:34
@marcocesarato marcocesarato marked this pull request as ready for review October 14, 2025 19:37
@marcocesarato marcocesarato merged commit b5d6e19 into main Oct 14, 2025
1 of 3 checks passed
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.

Author

2 participants