-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
Added automatic size labeler #37262
Added automatic size labeler #37262
Conversation
1eeac5f
to
56602ef
Compare
56602ef
to
3dabee0
Compare
That's a pretty dramatic transition from "tiny" to "huge" in 1 line... |
I was thinking something like |
It may be useful to illustrate such a proposal by putting examples of PRs of such sizes in the description, to facilitate discussion. Also consider whether labels are necessary for the sizes in the middle. Labels for the smallest category and for the largest category have clear functions (which?) |
First some questions:
|
Not using the GitHub Action will give us flexibility. I was thinking using regex, we can skip blank lines and also exclude changes in documentation from counting towards the final number of lines changed.
I don't know how can we do this, hitting Github label's endpoint won't return who added those labels.
I'll address these issues on my next commit.
This worked fine, I tested the code on one of my repo. |
Yes, flexibility is a good point, but I'm not sure we should exclude changes in documentation.
The
Great!
I think it would be less critical here than with state labels, but we should keep attention on this. FYI: I won't reply for a week as I'm on vacation. |
728ca5b
to
28d9088
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry! Maybe I gave a bad hint. I expected that the logic could be included in the Python file, but I overlooked the fact that sync_labels
doesn't checkout the entire repository (for performance reasons), which is what is needed here. Therefore, I'm no longer sure whether it makes sense to include the code in sync_labels.yml
. I hope that reverting to the previous version won't cause you too much trouble.
However, I tested your code a bit in my fork soehms#13. So far things are looking good to me. But maybe you should consider making the constants (SMALL_THRESHOLD
...) changeable via repository variables.
Sure! |
7739cd7
to
9448ab9
Compare
9448ab9
to
da0903d
Compare
Sounds reasonable! If you have the resources to do it, please do it! I wouldn't let the job fail if the repository variables are not set. It's better to just skip it. Otherwise, after the PR is merged but the variables are not set, every open PR would have at least one failed job after each push. Some notes on code style and structure:
|
I have implemented the `automatic size labeler`, which now assigns labels to pull requests based on the number of lines changed **Minimal** Typically involves very small changes, bug fixes, or updates that require only a few lines of code, often less than 50. sagemath#37208 sagemath#37146 sagemath#37043 **Small** Involves more substantial changes than minimal, potentially adding new features or making modifications to existing ones. The range is usually between 50 to 100 lines of code. sagemath#37152 sagemath#37132 **Moderate** Represents a significant portion of the codebase being modified, such as adding new features, refactoring, or making extensive changes to existing functionalities. This might involve between 100 to 300 lines of code. sagemath#36919 sagemath#37112 **Large** Involves substantial and complex changes across various parts of the codebase. This could include major architectural changes, the introduction of new modules, or a significant overhaul of existing features, often exceeding 300 lines of code. sagemath#37125 sagemath#36977 sagemath#36972 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. Fixes: sagemath#37254 URL: sagemath#37262 Reported by: Aman Moon Reviewer(s): Sebastian Oehms
I have implemented the `automatic size labeler`, which now assigns labels to pull requests based on the number of lines changed **Minimal** Typically involves very small changes, bug fixes, or updates that require only a few lines of code, often less than 50. sagemath#37208 sagemath#37146 sagemath#37043 **Small** Involves more substantial changes than minimal, potentially adding new features or making modifications to existing ones. The range is usually between 50 to 100 lines of code. sagemath#37152 sagemath#37132 **Moderate** Represents a significant portion of the codebase being modified, such as adding new features, refactoring, or making extensive changes to existing functionalities. This might involve between 100 to 300 lines of code. sagemath#36919 sagemath#37112 **Large** Involves substantial and complex changes across various parts of the codebase. This could include major architectural changes, the introduction of new modules, or a significant overhaul of existing features, often exceeding 300 lines of code. sagemath#37125 sagemath#36977 sagemath#36972 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. Fixes: sagemath#37254 URL: sagemath#37262 Reported by: Aman Moon Reviewer(s): Sebastian Oehms
@soehms, The Action variables are not set, leading the action to be skipped. |
This must be done by a maintainer of the repository. @mkoeppe, can you enable the feature by setting the repository variables |
I've added these variables with values 50, 100, 300, as per ticket description (to my understanding) |
I think that would be a great idea. Also it would be good to explain it in https://github.com/sagemath/sage/wiki/Sage-10.4-Release-Tour#automatic-pr-size-labeler -- I've only created this section as a stub |
Thanks! |
See https://groups.google.com/g/sage-devel/c/w4IeYgXgVUc.
I filled in a sentence there. |
@amanmoon You should have a look at this workflow run. |
If the author does not have the latest develop branch (with this auto labeler PR merged) merged with his PR, the file not found error will occur. The |
I see!
I don't think this is necessary!
This looks like a line feed occurs at the end of the |
Indeed. I've removed it. |
I think it would be better if the script was taken from a separate checkout of the Also, recently I have switched to putting such helper scripts in the |
It is also possible to checkout single files (see for example here).
I agree! There are some more to move:
@amanmoon, can you open a corresponding follow-up PR? |
Note I'm taking care of some of the scripts in: |
Note that @tscrim started a discussion on the benefit of the labels in the sage-devel-thread. |
There's a complaint that the size is sometimes wrong: https://groups.google.com/g/sage-devel/c/w4IeYgXgVUc/m/Og7NP-3VAQAJ |
Moved the file set_labels_by_changes.sh to to the .ci directory. The workflow runs from the main repo. Fixed bug, the correct labels will be added even if the feature branch is behind. sagemath#37262 sagemath#37262 (comment) https://groups.google.com/g/sage-devel/c/w4IeYgXgVUc/m/Og7NP-3VAQAJ <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. URL: sagemath#38114 Reported by: Aman Moon Reviewer(s): Matthias Köppe
Moved the file set_labels_by_changes.sh to to the .ci directory. The workflow runs from the main repo. Fixed bug, the correct labels will be added even if the feature branch is behind. sagemath#37262 sagemath#37262 (comment) https://groups.google.com/g/sage-devel/c/w4IeYgXgVUc/m/Og7NP-3VAQAJ <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. URL: sagemath#38114 Reported by: Aman Moon Reviewer(s): Matthias Köppe
Moved the file set_labels_by_changes.sh to to the .ci directory. The workflow runs from the main repo. Fixed bug, the correct labels will be added even if the feature branch is behind. sagemath#37262 sagemath#37262 (comment) https://groups.google.com/g/sage-devel/c/w4IeYgXgVUc/m/Og7NP-3VAQAJ <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. URL: sagemath#38114 Reported by: Aman Moon Reviewer(s): Matthias Köppe
Moved the file set_labels_by_changes.sh to to the .ci directory. The workflow runs from the main repo. Fixed bug, the correct labels will be added even if the feature branch is behind. sagemath#37262 sagemath#37262 (comment) https://groups.google.com/g/sage-devel/c/w4IeYgXgVUc/m/Og7NP-3VAQAJ <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. URL: sagemath#38114 Reported by: Aman Moon Reviewer(s): Matthias Köppe
Sorry, I lost track of this hint. At least because of that @vdelecroix is right in speaking of a wrong guidance in this sage-devel post. Another point is that I did not expect this PR to become controversial because I thought the naming of the labels made it clear that they were just quantitative indicators that could help with preselection in the GitHub search function. Now, I agree with @tscrim that we should have involved sage-devel much earlier. |
<!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> We revert sagemath#37262. This was voted on sage-devel: https://groups.google.com/g/sage-devel/c/3PLZD-4UFIA ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#38334 Reported by: Travis Scrimshaw Reviewer(s): Sebastian Oehms
I have implemented the
automatic size labeler
, which now assigns labels to pull requests based on the number of lines changedMinimal
Typically involves very small changes, bug fixes, or updates that require only a few lines of code, often less than 50.
#37208 #37146 #37043
Small
Involves more substantial changes than minimal, potentially adding new features or making modifications to existing ones. The range is usually between 50 to 100 lines of code.
#37152 #37132
Moderate
Represents a significant portion of the codebase being modified, such as adding new features, refactoring, or making extensive changes to existing functionalities. This might involve between 100 to 300 lines of code.
#36919 #37112
Large
Involves substantial and complex changes across various parts of the codebase. This could include major architectural changes, the introduction of new modules, or a significant overhaul of existing features, often exceeding 300 lines of code.
#37125 #36977 #36972
📝 Checklist
Fixes: #37254