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

[Merged by Bors] - [Fixes #6059] Entity's “ID” should be named “index” instead #6107

Closed
wants to merge 20 commits into from

Conversation

Edwox
Copy link
Contributor

@Edwox Edwox commented Sep 26, 2022

Objective

Fixes #6059, changing all incorrect occurrences of id in the entity module to index:

  • struct level documentation,
  • id struct field,
  • id method and its documentation.

Solution

Renaming and verifying using CI.

Migration Guide

The Entity::id() method was renamed to Entity::index().

@Edwox
Copy link
Contributor Author

Edwox commented Sep 26, 2022

Could someone help me apply the label specified in #6059? It was the C-Breaking-Change label.

@Edwox Edwox changed the title [Fixes #6059] Renamed id in the Entity struct to index [Fixes #6059] Entity's “ID” should be named “index” instead Sep 26, 2022
Copy link
Contributor

@tguichaoua tguichaoua left a comment

Choose a reason for hiding this comment

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

There is few places where "id" should be change into "index".

crates/bevy_ecs/src/entity/mod.rs Show resolved Hide resolved
crates/bevy_ecs/src/entity/mod.rs Show resolved Hide resolved
crates/bevy_ecs/src/entity/mod.rs Outdated Show resolved Hide resolved
crates/bevy_ecs/src/entity/mod.rs Outdated Show resolved Hide resolved
crates/bevy_ecs/src/entity/mod.rs Outdated Show resolved Hide resolved
@Nilirad Nilirad added C-Docs An addition or correction to our documentation A-ECS Entities, components, systems, and events C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide labels Sep 26, 2022
@Nilirad
Copy link
Contributor

Nilirad commented Sep 26, 2022

Could someone help me apply the label specified in #6059? It was the C-Breaking-Change label.

Done. (my bad, I forgot that only organization members can tag issues and PRs)

@Edwox
Copy link
Contributor Author

Edwox commented Sep 28, 2022

There is few places where "id" should be change into "index".

My plan was to do the changes incrementally. So I started off by just changing the id in the entity struct and all resulting dependency issues. The plan was then to start working on the documentation and so on.

Could someone help me apply the label specified in #6059? It was the C-Breaking-Change label.

Done. (my bad, I forgot that only organization members can tag issues and PRs)

Thank you! :)

@Edwox
Copy link
Contributor Author

Edwox commented Oct 3, 2022

Could I get some help with CI / build (macos-latest)? It gets timed out.

@Nilirad
Copy link
Contributor

Nilirad commented Oct 3, 2022

bors try

bors bot added a commit that referenced this pull request Oct 3, 2022
@bors
Copy link
Contributor

bors bot commented Oct 3, 2022

try

Build failed:

@Nilirad
Copy link
Contributor

Nilirad commented Oct 3, 2022

Looks like there's some code that is only compiled in wasm builds. It wasn't changed probably because rust-analyzer checks for the default target.

If you do cargo check -p bevy_ecs --all-targets you may be able to reproduce the errors locally (-p bevy_ecs only restricts the check to that crate).

@Edwox
Copy link
Contributor Author

Edwox commented Oct 3, 2022

Looks like there's some code that is only compiled in wasm builds. It wasn't changed probably because rust-analyzer checks for the default target.

If you do cargo check -p bevy_ecs --all-targets you may be able to reproduce the errors locally (-p bevy_ecs only restricts the check to that crate).

Thank you! I believe that the issue should be resolved now. 😃

@Edwox Edwox marked this pull request as ready for review October 5, 2022 15:26
Copy link
Contributor

@xgbwei xgbwei left a comment

Choose a reason for hiding this comment

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

A few variables named idx in sparse_set.rs need to be updated.

crates/bevy_ecs/src/storage/sparse_set.rs Outdated Show resolved Hide resolved
crates/bevy_ecs/src/storage/sparse_set.rs Outdated Show resolved Hide resolved
Copy link
Contributor Author

@Edwox Edwox left a comment

Choose a reason for hiding this comment

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

A few variables named idx in sparse_set.rs need to be updated.

okay, I agree with these changes. I will get right on it. 😄

Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

I'm in favor of this change, and this is well-done. Can you please resolve the comments as you address them to make it easier for reviewers to track what needs to be done?

@Edwox
Copy link
Contributor Author

Edwox commented Oct 17, 2022

I'm in favor of this change, and this is well-done. Can you please resolve the comments as you address them to make it easier for reviewers to track what needs to be done?

Great, thank you! I think all comments should be resolved now.

Comment on lines 68 to 69
// Fetch the entity with the given entity index from the `entity_map`
// or spawn a new entity with a transiently unique index if there is
Copy link
Contributor

Choose a reason for hiding this comment

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

id is correct here.

Comment on lines 104 to 108
for component_index in self.world.entity(entity).archetype().components() {
let reflect_component = self
.world
.components()
.get_info(component_id)
.get_info(component_index)
Copy link
Contributor

Choose a reason for hiding this comment

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

component_id is correct here.

Copy link
Contributor Author

@Edwox Edwox left a comment

Choose a reason for hiding this comment

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

Of course, my bad! Will fix this right away.

Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Rebase LGTM.

@irate-devil
Copy link
Contributor

irate-devil commented Nov 2, 2022

Looks like there are some new calls to .id() that need to be changed to .index() that came in from the merge.

@Edwox
Copy link
Contributor Author

Edwox commented Nov 2, 2022

Looks like there are some new calls to .id() that need to be changed to .index() that came in from the merge.

Attempting to fix it right now.

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Nov 2, 2022
@alice-i-cecile
Copy link
Member

alice-i-cecile commented Nov 2, 2022

Can you please add the following to your PR description?

Migration Guide

The Entity::id() method was renamed to Entity::index().


bors r+

bors bot pushed a commit that referenced this pull request Nov 2, 2022
# Objective

Fixes #6059, changing all incorrect occurrences of ``id`` in the ``entity`` module to ``index``:

* struct level documentation,
* ``id`` struct field,
* ``id`` method and its documentation.

## Solution

Renaming and verifying using CI. 


Co-authored-by: Edvin Kjell <43633999+Edwox@users.noreply.github.com>
@Edwox
Copy link
Contributor Author

Edwox commented Nov 2, 2022

The description should be updated now.

@bors bors bot changed the title [Fixes #6059] Entity's “ID” should be named “index” instead [Merged by Bors] - [Fixes #6059] Entity's “ID” should be named “index” instead Nov 2, 2022
@bors bors bot closed this Nov 2, 2022
bors bot pushed a commit that referenced this pull request Nov 22, 2022
Continuation of #6107

Co-authored-by: devil-ira <justthecooldude@gmail.com>
taiyoungjang pushed a commit to taiyoungjang/bevy that referenced this pull request Dec 15, 2022
Continuation of bevyengine#6107

Co-authored-by: devil-ira <justthecooldude@gmail.com>
@Edwox Edwox deleted the bevy_entity_id_to_index branch December 16, 2022 08:09
alradish pushed a commit to alradish/bevy that referenced this pull request Jan 22, 2023
Continuation of bevyengine#6107

Co-authored-by: devil-ira <justthecooldude@gmail.com>
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
…tead (bevyengine#6107)

# Objective

Fixes bevyengine#6059, changing all incorrect occurrences of ``id`` in the ``entity`` module to ``index``:

* struct level documentation,
* ``id`` struct field,
* ``id`` method and its documentation.

## Solution

Renaming and verifying using CI. 


Co-authored-by: Edvin Kjell <43633999+Edwox@users.noreply.github.com>
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
Continuation of bevyengine#6107

Co-authored-by: devil-ira <justthecooldude@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide C-Docs An addition or correction to our documentation S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Entity's “ID” should be named “index” instead
7 participants