Skip to content

lib: make event static properties non writable and configurable - #50425

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
BenzeneAlcohol:event_target_bug
Nov 10, 2023
Merged

lib: make event static properties non writable and configurable#50425
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
BenzeneAlcohol:event_target_bug

Conversation

@BenzeneAlcohol

Copy link
Copy Markdown
Contributor

The idl definition for Event makes the properties constants, this means that they shouldn't be configurable. However, they were, and this commit fixes that.

Fixes: #50417

@nodejs-github-botnodejs-github-bot added the needs-ci PRs that need a full CI run. label Oct 27, 2023
@BenzeneAlcohol

Copy link
Copy Markdown
ContributorAuthor

making writable: false, makes it such that the user cannot even assign a value. Is that what we intend at the end?

@BenzeneAlcohol

Copy link
Copy Markdown
ContributorAuthor

I've run the linter and fixed the errors, and also changed up stuff a bit.

Please review @KhafraDev

@H4ad
H4ad requested a review from KhafraDevOctober 30, 2023 15:36
@H4adH4ad added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Oct 30, 2023
@H4ad

H4ad commented Oct 30, 2023

Copy link
Copy Markdown
Member

@BenzeneAlcohol Can you please fix the issue on the first commit?

https://github.com/nodejs/node/actions/runs/6690083519/job/18190085079?pr=50425

But thanks for the PR, looks great!

@BenzeneAlcohol

Copy link
Copy Markdown
ContributorAuthor

@BenzeneAlcohol Can you please fix the issue on the first commit?

https://github.com/nodejs/node/actions/runs/6690083519/job/18190085079?pr=50425

But thanks for the PR, looks great!

Done, thank you! :)

@BenzeneAlcohol

Copy link
Copy Markdown
ContributorAuthor

The test for some reason runs on the old commit message?
Do I have to squash all the commits into one manually?

@BenzeneAlcohol

Copy link
Copy Markdown
ContributorAuthor

Any changes I have to further make?

@H4ad

H4ad commented Oct 31, 2023

Copy link
Copy Markdown
Member

You can squash everything, or you can rebase, but you need to change the commit message, both should work.

@BenzeneAlcohol

Copy link
Copy Markdown
ContributorAuthor

Squashed into one commit.

Comment threadlib/internal/event_target.js Outdated
Comment threadtest/parallel/test-event-target.js Outdated
@BenzeneAlcohol

Copy link
Copy Markdown
ContributorAuthor

Ok, I have a very noob question.

But I do some small changes, and every time do I have to make the detailed commit message? Because sometimes the change I do is like removing a few lines (like I removed a few console lines) but then the commit message should contain details about the actual change in case it gets merged.

So do I just wait for approval, then rebase all changes to 1 commit message? And have normal commit messages, 1 liners till that one final rebased single commit.

Comment threadlib/internal/event_target.js Outdated
H4ad
H4ad approved these changes Nov 1, 2023
@H4ad

H4ad commented Nov 1, 2023

Copy link
Copy Markdown
Member

From what I know, only the first message will be used to create the commit description, so it's fine you keep the first commit with the message and then create other commits for minor fixes.

About all commits, I will later add a flag to squash everything, so all the commits will be released as just one commit.

@KhafraDev

Copy link
Copy Markdown
Member

But I do some small changes, and every time do I have to make the detailed commit message? Because sometimes the change I do is like removing a few lines (like I removed a few console lines) but then the commit message should contain details about the actual change in case it gets merged.

I believe only the first commit must be detailed, because they typically get squashed automatically when merged.

Personally, I use git rebase -i HEAD~[number of commits] and then squash all the commits together into the first one, then git push -f. That way I only need to worry about a single commit.

@BenzeneAlcohol

Copy link
Copy Markdown
ContributorAuthor

But I do some small changes, and every time do I have to make the detailed commit message? Because sometimes the change I do is like removing a few lines (like I removed a few console lines) but then the commit message should contain details about the actual change in case it gets merged.

I believe only the first commit must be detailed, because they typically get squashed automatically when merged.

Personally, I use git rebase -i HEAD~[number of commits] and then squash all the commits together into the first one, then git push -f. That way I only need to worry about a single commit.

Got it, thanks!

@BenzeneAlcohol

Copy link
Copy Markdown
ContributorAuthor

From what I know, only the first message will be used to create the commit description, so it's fine you keep the first commit with the message and then create other commits for minor fixes.

About all commits, I will later add a flag to squash everything, so all the commits will be released as just one commit.

Alrighty!

@H4adH4ad added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 1, 2023
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 1, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Comment threadtest/parallel/test-event-target.js Outdated
@BenzeneAlcohol

Copy link
Copy Markdown
ContributorAuthor

Does that failed pipeline for 4 checks indicate any changes I have to do or are they some flaky tests?

@MrJithil

Copy link
Copy Markdown
Member

Its not because of your changes.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@BenzeneAlcohol

Copy link
Copy Markdown
ContributorAuthor

Ok, I've made the changes hopefully the pipeline runs successfully 👀

Please look into the pending comment too

Done

@MrJithilMrJithil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@H4adH4ad added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Nov 3, 2023
H4ad
H4ad approved these changes Nov 3, 2023
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 3, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@tniessentniessen changed the title lib: Event static properties non configurable and writablelib: make event static properties non writable and configurableNov 3, 2023
@tniessen

Copy link
Copy Markdown
Member

Is this semver-major or do we consider it a bug fix?

@H4ad

H4ad commented Nov 3, 2023

Copy link
Copy Markdown
Member

I think it is a bug fix since people are not supposed to change/modify these properties.

But if we want to be cautious, a semver-minor can be applied.

Maybe run CITMG too?

@KhafraDev

KhafraDev commented Nov 3, 2023

Copy link
Copy Markdown
Member

definitely a bug fix, I wouldn't consider it a major change. If someone relied on changing these properties, they were relying on a bug.

@BenzeneAlcohol

Copy link
Copy Markdown
ContributorAuthor

definitely a bug fix, I wouldn't consider it a major change. If someone relied on changing these properties, they were relying on a bug.

Agreed. Does it need semver-minor?

@BenzeneAlcohol

Copy link
Copy Markdown
ContributorAuthor

Does this need anything else before merging?

@BenzeneAlcohol

Copy link
Copy Markdown
ContributorAuthor

@KhafraDev and @H4ad any blockers stopping this from merge?

@tniessentniessen added the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 10, 2023
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 10, 2023
@nodejs-github-bot
nodejs-github-bot merged commit b4850f2 into nodejs:mainNov 10, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in b4850f2

@MrJithil

MrJithil commented Nov 10, 2023

Copy link
Copy Markdown
Member

@KhafraDev and @H4ad any blockers stopping this from merge?

IMO No. It's already landed

targos pushed a commit that referenced this pull request Nov 11, 2023
The idl definition for Event makes the properties constant
this means that they shouldn't be configurable and writable.
However, they were, and this commit fixes that.
Fixes: #50417
PR-URL: #50425
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
@targostargos mentioned this pull request Nov 12, 2023
targos pushed a commit that referenced this pull request Nov 14, 2023
The idl definition for Event makes the properties constant
this means that they shouldn't be configurable and writable.
However, they were, and this commit fixes that.
Fixes: #50417
PR-URL: #50425
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
UlisesGascon pushed a commit that referenced this pull request Dec 11, 2023
The idl definition for Event makes the properties constant
this means that they shouldn't be configurable and writable.
However, they were, and this commit fixes that.
Fixes: #50417
PR-URL: #50425
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
@UlisesGasconUlisesGascon mentioned this pull request Dec 12, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

events: static properties are configurable & writable

6 participants

@BenzeneAlcohol@H4ad@KhafraDev@nodejs-github-bot@MrJithil@tniessen