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

Better handling of companies.xml #148

Open
jamsix opened this issue Jan 3, 2025 · 4 comments
Open

Better handling of companies.xml #148

jamsix opened this issue Jan 3, 2025 · 4 comments
Assignees

Comments

@jamsix
Copy link
Owner

jamsix commented Jan 3, 2025

#146

companies.xml is currently overrriden with the latest version from this repo if the file has not been modified for 30 days. That can be annoying for users that modify the file locally as they loose their data w/o a warning.

Think about how we should implement this with the following goals in mind:

  • Users should have a decently up-to-date companies.xml without any manual action
  • Users should be able to add companies to their local file without loosing the changes
  • Users should be motivated to submit their added companies back to repo
@MaJerle
Copy link
Contributor

MaJerle commented Jan 3, 2025

Optional solution to not override is to introduce the user_companies.xml file that can be used by the user on their own, never modified. This file shall be added to the repo as user_companies_template.xml, user can rename it, and doesn't track it. .gitignore can be updated, too. This still doesn't solve the point 3, a motivation to submit changes back, as it would need to copy them to companies.xml before creating pull request.

Another option might be to introduce companies_yyyy_mm_dd.xml where date is the pull date. Script then globs for all files in a given format and creates the global picture of all companies from all files + user's one. If user modifies the companies.xml, one can still send back the changes as a pull request. The question remains, what happens if file on the server is far up to date compared to file he had before adding those changes in the companies.xml file.

@nikegp
Copy link
Contributor

nikegp commented Jan 12, 2025

Since the purpose of updating the file is to help end users (ourselves) then it makes sense to ask the users if an update is detected, i.e.:

  • on every run, the script downloads the file from the repo into a temp destination
  • it compares the downloaded file with the local one
  • If the size differs, print a prompt that says, "Changes in companies.xml are detected. If you haven't modified it locally, then contributors have added new companies. Do you want to keep the local one (y) or update it from the repo (n)?"

People with new companies locally will reply "(n)" keeping local changes and then will commit them back to the repo. Those who haven't modified it will receive recent updates.

@Jerige
Copy link

Jerige commented Feb 3, 2025

There could be also a switch to run ib_edavki to tell the program not to download companies but to use local file which user modified with missing companies.

@jamsix
Copy link
Owner Author

jamsix commented Feb 3, 2025

Can one of you test #158 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants