Skip to content

Conversation

@ShivamRajSri
Copy link

@ShivamRajSri ShivamRajSri commented Dec 3, 2025

This PR improves the deprecation warning message shown by warn_deprecation() in aiida/common/warnings.py.
It now includes links to AiiDA’s Discourse forum and GitHub issue tracker so that users can more easily report bugs or unexpected behavior.

Example output:
This feature is deprecated (this will be removed in v3)

If you encounter unexpected behavior or bugs, please report them via:
Discourse: https://aiida.discourse.group
GitHub: https://github.com/aiidateam/aiida-core/issues

Closes #6912

@danielhollas
Copy link
Collaborator

I am not sure this is good idea. @ShivamRajSri has this been discussed somewhere?

@ShivamRajSri
Copy link
Author

Thanks for the feedback, @danielhollas!
Yes — this change is based on the Good First Issue titled “Add link to Discourse and GitHub in warning” (#issue-number:#6912
).
I implemented the improvement as described there — to include the Discourse and GitHub links in the deprecation warning message so users can easily report bugs or unexpected behavior.
Please let me know if there’s any preferred formatting or additional context I should include. Happy to adjust it as needed!

@danielhollas
Copy link
Collaborator

I see. There is a bit of a misunderstanding of the issu, this should not be added to the deprecation message. Rather, the Github/Discourse links should be added to the already existing "If you encounter unexpected behavior or bugs, please report them via Discourse or GitHub." which already exists in a couple of places (you can grep/search for "Discourse" to find them, for example in src/aiida/cmdline/commands/cmd_process.py.

@ShivamRajSri
Copy link
Author

Thanks a lot for the clarification, @danielhollas!
You’re right - I misunderstood the issue scope.
I’ll update the existing warning messages (like in cmd_process.py) to include the proper Discourse and GitHub links instead of changing the deprecation warning.
I’ll push the fix shortly.

@ShivamRajSri
Copy link
Author

Thanks for clarifying, @danielhollas!
I checked for other occurrences and found this message only in src/aiida/cmdline/commands/cmd_process.py.
I’ve updated it to include the full Discourse and GitHub links as suggested.
Please let me know if there are any other places you’d like me to update.

@ShivamRajSri
Copy link
Author

Hi @danielhollas
Just wanted to kindly check in if there’s anything else needed from my side for this PR.
I’ve updated the code as discussed and verified the message change locally.
Thank you again for the guidance — happy to adjust anything further if needed!

Add Discourse and GitHub links to deprecation warnings
Removed additional warning details from deprecation message.
@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.60%. Comparing base (d94a472) to head (94116b2).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7123   +/-   ##
=======================================
  Coverage   79.60%   79.60%           
=======================================
  Files         566      566           
  Lines       43587    43587           
=======================================
  Hits        34694    34694           
  Misses       8893     8893           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@danielhollas danielhollas left a comment

Choose a reason for hiding this comment

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

Hi @ShivamRajSri,

thanks for the ping! There are two more places to modify

$ cd src/aiida
$ git grep Discourse
cmdline/commands/cmd_group.py:        'If you encounter unexpected behavior or bugs, please report them via Discourse or GitHub.'
cmdline/commands/cmd_process.py:        'If you encounter unexpected behavior or bugs, please report them via Discourse or GitHub.'
cmdline/commands/cmd_profile.py:        'If you encounter unexpected behavior or bugs, please report them via Discourse or GitHub.'

Also the code needs to be formatted. We use the ruff autoformatter which you can run with pre-commit. I'd recommend installing uv (to handle dependencies instead of pip) and then doing

uv run pre-commit run -a ruff-format

Let me know if you run into issues.

@ShivamRajSri
Copy link
Author

Hi @danielhollas,
thanks a lot for the detailed pointers!
I’ll update the remaining occurrences in cmd_group.py and cmd_profile.py and run the formatter using ruff via pre-commit as suggested.
I’ll push the updates shortly. Thanks again for the guidance!

@ShivamRajSri
Copy link
Author

Thanks for the pointers, @danielhollas! 🙏
I’ve now updated the remaining occurrences and ran ruff-format via pre-commit.
The formatter reformatted the relevant files and the changes have been pushed.
Please let me know if everything looks good now.

@danielhollas danielhollas self-requested a review December 20, 2025 01:22
Copy link
Collaborator

@danielhollas danielhollas left a comment

Choose a reason for hiding this comment

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

@ShivamRajSri thank you, this looks good now! Thanks for your work. 💪

Image

I'll leave final approve to @agoscinski since he's the one who originally created the issue.

@ShivamRajSri
Copy link
Author

Thanks a lot, @danielhollas!
I really appreciate the review and guidance. Glad to hear everything looks good now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

Add link to Discourse and Github in CLI warning

2 participants