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

Migrate internal code to use Direct Message terminology #1553

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

Ajnus
Copy link
Collaborator

@Ajnus Ajnus commented Oct 28, 2024

What does this PR do, and why?

Replaces instances of:
private, privates, _ private, private _, PRIVATE, PRIVATES, Private , pm, pms, _ pm, pm _, PM, Pm
(and derivatives, e.g: _is_private_message_to_self, private_msg_ids, private_msg_ids_by_user_ids, (...))

to Direct Message terminology, avoiding the test_model.py, model.py files, strings and other instances related to the API, for API consistency reasons, while "exploring other parts", such as replacing comments.

This PR consists of the - on-chat debated - first part of altering just internal code, not the second that focus on API related code.

External discussion & connections

How did you test this?

  • Manually - Behavioral changes
  • Manually - Visual changes
  • Adapting existing automated tests
  • Adding automated tests for new behavior (or missing tests)
  • Existing automated tests should already cover this (only a refactor of tested code)
  • It runs
    image

Self-review checklist for each commit

  • It is a minimal coherent idea
  • It has a commit summary following the documented style (title & body)
  • It has a commit summary describing the motivation and reasoning for the change
  • It individually passes linting and tests
  • It contains test additions for any new behavior
  • It flows clearly from a previous branch commit, and/or prepares for the next commit

@zulipbot zulipbot added the size: XL [Automatic label added by zulipbot] label Oct 28, 2024
Copy link
Member

@rsashank rsashank left a comment

Choose a reason for hiding this comment

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

@Ajnus Thanks for working on this! I haven’t reviewed the changes in detail.

But in the tests, ZT relies on gitlint to enforce specific commit message rules. The README includes setup instructions for adding a gitlint commit-message hook, which lets you test locally and ensure your commit messages follow the required format.

While your commit messages generally look good, they don’t fully comply with gitlint’s formatting rules.

@@ -10,10 +10,10 @@
from zulipterminal.config.symbols import CHECK_MARK, MUTE_MARKER
from zulipterminal.ui_tools.buttons import (
DecodedStream,
DMButton,
Copy link
Member

Choose a reason for hiding this comment

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

Additionally, avoid using separate commits solely to fix test issues. Every test must pass on each commit since the Linting & tests / Ensure isolated PR commits (pull_request) check ensures that all commits stand alone successfully.

Maybe try rebasing to correct issues in each commit as needed.

For example:

In the commit Refactor: replace 'PM' with 'DM' (ignoring model.py, test_model.py, f…), isort is not satisfied (which you fixed in this commit separately). Rebase, address this, and make sure each commit individually passes all tests.

Copy link
Collaborator Author

@Ajnus Ajnus Oct 30, 2024

Choose a reason for hiding this comment

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

My pleasure @rsashank 🫡
Indeed, the Linting & tests / Lint - Commit text format (gitlint) (pull_request) was, at the time, the last test that needed a fixing - which I just did. :)

However, by fixing it - maybe that's just how it happens, still a newcomer into contributing don't really know yet - from 2 other tests that were skipped, now Linting & tests / Ensure isolated PR commits (pull_request) do tests, and fails - the other last test still skipped, probably one test depends on the other and so on I imagine - so, the 1 commit per test passed was more a (yesterday) deadline (presentation) issue, although this structure does help me track which tests are good - even because from what I understand the tests only (re)run after a push to the repository is made - and which are not.
But overall in the end I'll just squash everything to what's better for you guys.

Stay tuned for the next episodes. =]

Copy link
Member

Choose a reason for hiding this comment

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

Got it! I just thought some clarification might be helpful since I assumed you were new to this. My mistake if I jumped in too early!

Good luck :)

@Ajnus Ajnus force-pushed the issue_#1344 branch 2 times, most recently from 0022d40 to 09ba862 Compare October 30, 2024 13:26
@neiljp
Copy link
Collaborator

neiljp commented Oct 30, 2024

@Ajnus Just a quick note re testing in general - these can all be run locally, as per the development notes in the README. In particular there is tools/check-branch, for the isolated commit check itself.

@zulipbot
Copy link
Member

zulipbot commented Nov 5, 2024

Hello @Ajnus, it seems like you have referenced #1344 in your pull request description, but you have not referenced them in your commit message description(s). Referencing an issue in a commit message automatically closes the corresponding issue when the commit is merged, which makes the issue tracker easier to manage.

Please run git commit --amend in your command line client to amend your commit message description with Fixes #1344..

An example of a correctly-formatted commit:

commit fabd5e450374c8dde65ec35f02140383940fe146
Author: zulipbot
Date:   Sat Mar 18 13:42:40 2017 -0700

    pull requests: Check PR commits reference when issue is referenced.

    Fixes #51.

To learn how to write a great commit message, please refer to our guide.

@Ajnus
Copy link
Collaborator Author

Ajnus commented Nov 5, 2024

Hello @Ajnus, it seems like you have referenced #1344 in your pull request description, but you have not referenced them in your commit message description(s). Referencing an issue in a commit message automatically closes the corresponding issue when the commit is merged, which makes the issue tracker easier to manage.

Please run git commit --amend in your command line client to amend your commit message description with Fixes #1344..

An example of a correctly-formatted commit:

commit fabd5e450374c8dde65ec35f02140383940fe146
Author: zulipbot
Date:   Sat Mar 18 13:42:40 2017 -0700

    pull requests: Check PR commits reference when issue is referenced.

    Fixes #51.

To learn how to write a great commit message, please refer to our guide.

Doesn't this breaks
@github-actions
Linting & tests / Lint - Commit text format (gitlint) (pull_request) ?

@Ajnus
Copy link
Collaborator Author

Ajnus commented Nov 5, 2024

@Ajnus Just a quick note re testing in general - these can all be run locally, as per the development notes in the README. In particular there is tools/check-branch, for the isolated commit check itself.

Can't really. Even after make test

Captura de tela de 2024-11-05 17-55-20

@Ajnus Ajnus force-pushed the issue_#1344 branch 8 times, most recently from 1502677 to de0e831 Compare November 5, 2024 22:44
@timabbott
Copy link
Member

@Ajnus the commit history needs to be cleaned up before this will be ready for review. Check out our GitHub guide and commit guidelines for more details.

@Ajnus
Copy link
Collaborator Author

Ajnus commented Nov 7, 2024

@timabbott check the zulip chat please.

@Ajnus Ajnus force-pushed the issue_#1344 branch 9 times, most recently from e69a8e4 to 9714c43 Compare November 13, 2024 20:33
@Ajnus Ajnus force-pushed the issue_#1344 branch 14 times, most recently from 4b0afc4 to 7fc7202 Compare November 14, 2024 19:26
@Ajnus Ajnus requested a review from rsashank November 14, 2024 19:48
@Ajnus Ajnus force-pushed the issue_#1344 branch 3 times, most recently from 7fc7202 to c5bc5c1 Compare November 14, 2024 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: XL [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TRACKING: Migrate internal code to use Direct Message terminology
5 participants