Skip to content

sync perfect-numbers#1619

Merged
jiegillet merged 2 commits intoexercism:mainfrom
FraSanga:sync-perfect-numbers
Mar 9, 2026
Merged

sync perfect-numbers#1619
jiegillet merged 2 commits intoexercism:mainfrom
FraSanga:sync-perfect-numbers

Conversation

@FraSanga
Copy link
Contributor

@FraSanga FraSanga commented Mar 7, 2026

Copilot AI review requested due to automatic review settings March 7, 2026 17:06
@github-actions
Copy link
Contributor

github-actions bot commented Mar 7, 2026

Thank you for contributing to exercism/elixir 💜 🎉. This is an automated PR comment 🤖 for the maintainers of this repository that helps with the PR review process. You can safely ignore it and wait for a maintainer to review your changes.

Based on the files changed in this PR, it would be good to pay attention to the following details when reviewing the PR:

  • General steps

    • 🏆 Does this PR need to receive a label with a reputation modifier (x:size/{tiny,small,medium,large,massive})? (A medium reputation amount is awarded by default, see docs)
  • Any exercise changed

    • 👤 Does the author of the PR need to be added as an author or contributor in <exercise>/.meta/config.json (see docs)?
    • 🔬 Do the analyzer and the analyzer comments exist for this exercise? Do they need to be changed?
    • 📜 Does the design file (<exercise>/.meta/design.md) need to be updated to document new implementation decisions?
  • Practice exercise changed

    • 🌲 Do prerequisites, practices, and difficulty in config.json need to be updated?
    • 🧑‍🏫 Are the changes in accordance with the community-wide problem specifiations?
  • Practice exercise tests changed

    • ⚪️ Are all tests except the first one skipped?
    • 📜 Does <exercise>/.meta/tests.toml need updating?

Automated comment created by PR Commenter 🤖.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 7, 2026

This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested.

If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos.

[no important files changed]

For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping @exercism/maintainers-admin in a comment. Thank you!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Syncs the Elixir perfect-numbers exercise with the latest problem-specifications metadata by updating the canonical test descriptions and adding the newly introduced abundant-number edge case.

Changes:

  • Added a new (pending) ExUnit test for classifying a perfect-square abundant number (196).
  • Updated .meta/tests.toml descriptions to the latest configlet-generated, hierarchical format and included the new test UUID/description.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
exercises/practice/perfect-numbers/test/perfect_numbers_test.exs Adds the new perfect-square abundant classification test case (pending).
exercises/practice/perfect-numbers/.meta/tests.toml Updates configlet-generated descriptions and adds the new canonical test entry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +48 to +52
[72445cee-660c-4d75-8506-6c40089dc302]
description = "Zero is rejected (not a natural number)"
description = "Invalid inputs -> Zero is rejected (as it is not a positive integer)"

[2d72ce2c-6802-49ac-8ece-c790ba3dae13]
description = "Negative integer is rejected (not a natural number)"
description = "Invalid inputs -> Negative integer is rejected (as it is not a positive integer)"
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests.toml descriptions for the invalid input cases were updated ("as it is not a positive integer"), but the corresponding ExUnit test names in test/perfect_numbers_test.exs still use the old wording ("not a natural number"). To keep the exercise in sync (and consistent with other exercises where the leaf description matches the test string), update those two test names to match the updated tests.toml descriptions.

Copilot uses AI. Check for mistakes.
@FraSanga
Copy link
Contributor Author

FraSanga commented Mar 7, 2026

Should I add [no important files changed]?

When I synchronised the tests, all the descriptions changed.
Should I restore them to how they were before or leave them as they are?
Should I listen to Copilot and fix perfect_numbers_test.exs and example.ex?

fixes #1615

@jiegillet jiegillet self-assigned this Mar 8, 2026
@jiegillet
Copy link
Contributor

Nice PR, thank you!

Should I add [no important files changed]?

No, in general when adding a new test it makes sense to run it for all students.

When I synchronised the tests, all the descriptions changed. Should I restore them to how they were before or leave them as they are? Should I listen to Copilot and fix perfect_numbers_test.exs and example.ex?

The tests.toml files are automatically generated/updated so we leave them as they are. The only manual intervention we do is adding comments to justify tests that we do not want to include, which is fairly rare (and not relevant here).

In doubt, it's better to align with the problem specs so let's sync the test descriptions. I don't really think it's worth adding the first parts "Invalid inputs -> " because they seem more like classifications for the problem specs maintainers, but the students need the last part "Zero is rejected (as it is not a positive integer)", so if you don't mind, let's update those. I think only two tests are concerned. Please double check that the tests content does match with the description.

and example.ex?

Did copilot mention something about this file? I don't think we need to touch it.

@FraSanga
Copy link
Contributor Author

FraSanga commented Mar 8, 2026

assert PerfectNumbers.classify(-1) == {:error, "Classification is only possible for natural numbers."}

I have corrected the descriptions, but I have left the error message unchanged, otherwise all the solutions will no longer be valid. It seems pointless to invalidate all the solutions for this minor detail.

Did copilot mention something about this file? I don't think we need to touch it.

I would have modified it to keep the changes consistent, but as mentioned above, I don't think that's necessary.

Copy link
Contributor

@jiegillet jiegillet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!

@jiegillet jiegillet merged commit 5eb78e9 into exercism:main Mar 9, 2026
8 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.

3 participants