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

Added directory for migration scripts and added item_ball migration script #3997

Merged

Conversation

pkmnsnfrn
Copy link
Collaborator

@pkmnsnfrn pkmnsnfrn commented Jan 14, 2024

Issue(s) that this PR fixes

Fixes #3996, fixes #3952

Discord contact info

I am pkmnsnfrn. I have already started a discussion thread.

@pkmnsnfrn pkmnsnfrn changed the title Migration script readme Added directory for migration scripts and added item_ball migration script Jan 14, 2024
@AlexOn1ine
Copy link
Collaborator

AlexOn1ine commented Jan 14, 2024

I think the folder name should make it more clear that it contains scripts. Migration can mean a lot of things.

/Edit: Maybe migration_scripts?

@AlexOn1ine
Copy link
Collaborator

Now that I think about it, I would remove the migration part. Not every script is a migration script and I think most will understand what is meant by scripts. Ig a migration subfolder could be added but I'm not sure.

@Bassoonian
Copy link
Collaborator

Bassoonian commented Jan 15, 2024

The main goal of these scripts is to be run once, then never again, so in that sense they are migration scripts. See also Edu's answer to #3952

@AlexOn1ine
Copy link
Collaborator

The main goal of these scripts is to be run once, then never again, so in that sense they are migration scripts. See also Edu's answer to #3952

Not everything though, right? Where would the python script go from PR #3856? It will run with every make assuming we agree on python support. Which I hope we will. didn't seem like there was much disagreement there and even SBird warmed up as long as outside libraries aren't introduced.

Edu also suggested the name python_scripts in the answer.

@Bassoonian
Copy link
Collaborator

Not everything though, right? Where would the python script go from PR #3856?

I was expecting it'd go in tools because it's, well, a tool, as opposed to this script, which is run once manually to migrate. If we ever implement triple layer tiles in expansion, SBird's script for that migration would also go in that folder

@AlexOn1ine
Copy link
Collaborator

Not everything though, right? Where would the python script go from PR #3856?

I was expecting it'd go in tools because it's, well, a tool, as opposed to this script, which is run once manually to migrate. If we ever implement triple layer tiles in expansion, SBird's script for that migration would also go in that folder

I see. Yeah, that makes sense. Then migration_scripts should be good.

Comment on lines +6 to +9
incs_to_check = glob.glob('./data/scripts/*.inc') # all .incs in the script folder
incs_to_check += glob.glob('./data/maps/*/scripts.inc') # all map scripts
pories_to_check = glob.glob('./data/scripts/*.pory') ## all .porys in the script folder
pories_to_check += glob.glob('./data/maps/*/scripts.pory') # all map scripts
Copy link
Collaborator

Choose a reason for hiding this comment

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

Those need changing if you run it from a sub-folder right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nah, I just tested it in a different Emerald and it seems to work, but somebody else should check on me on this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is odd. Afaik . is the root folder so it shouldn't work? I'll test it tomorrow.

Copy link
Collaborator

@AlexOn1ine AlexOn1ine Jan 16, 2024

Choose a reason for hiding this comment

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

Yep, just tested. It doesn't work. It needs to be changed to the parent directory.

Well, Idk. I guess a decision should be made here since you can run the script from the root folder python sub-folder/script.py. I guess it doesn't really matter but I would probably move into the scripts folder to run it if I didn't know better.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Migration scripts are executed by running the following commands from the root directory of a developer's project.

chmod +x migration_scripts/*.py ;
python3 migration_scripts/*.py ;

these are the instructions in the README. Do these instructions fail?

OR did you do:

cd migration_scripts ;
chmod +x *.py ;
python3 *.py

Copy link
Collaborator

Choose a reason for hiding this comment

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

I understand that python3 migration_scripts/*.py works. I'm just saying that people will go into the sub-folder and run the script from there without reading the instructions. Which will not work.

Btw is there a reason to add the executable permissions? It works fine without.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ig it's not really an important conversation. Whether you go into the folder and run the script from there or specify the correct path to it does accomplish the same thing in the end. Maybe there is a way to sneak in an Error Message if you run it from the wrong path?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah okay.

I don't think there's a good way to make sure it runs no matter where you run the script from. I could be wrong.

If a dev doesn't read the file called README, and then just runs a python script without context...

I'll remove the chmod line.

An error message would is a good idea!

Copy link
Collaborator

@AlexOn1ine AlexOn1ine left a comment

Choose a reason for hiding this comment

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

Hope everyone is fine with how it is set up now.

@AlexOn1ine AlexOn1ine merged commit 778712b into rh-hideout:upcoming Jan 16, 2024
1 check passed
@pkmnsnfrn pkmnsnfrn deleted the migration_script_readme branch April 20, 2024 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants