Skip to content

Handle website update #83#90

Merged
Neylix merged 3 commits intoarchethic-foundation:mainfrom
apoorv-2204:handle_website_update_#83
Feb 9, 2023
Merged

Handle website update #83#90
Neylix merged 3 commits intoarchethic-foundation:mainfrom
apoorv-2204:handle_website_update_#83

Conversation

@apoorv-2204
Copy link
Contributor

@apoorv-2204 apoorv-2204 commented Dec 28, 2022

This pr provides api to handle website update. When we upload a website, we might need to do some updates.
Redeploying from scratch is not an option.
Current One seed one website.
We must provide freedom to update website.

we fetch prev ref tx and compare its metadata with the updates files that user has provided.
We update metadata, for the changes files and include new files.

@apoorv-2204 apoorv-2204 requested review from Neylix, bchamagne, netboz, samuelmanzanera and tenmoves and removed request for samuelmanzanera January 1, 2023 17:12
@apoorv-2204 apoorv-2204 marked this pull request as ready for review January 1, 2023 17:12
@apoorv-2204 apoorv-2204 self-assigned this Jan 6, 2023
@apoorv-2204 apoorv-2204 added the feature new feature or enhancement label Jan 6, 2023
@bchamagne
Copy link
Contributor

bchamagne commented Jan 26, 2023

I tested 3 scenarios. 2/3 are successful.

  • ✔️ 1 file changed
  • ✔️ 2 files changed and 1 directory creation
  • 🔴 1 directory deletion

The 3rd scenario return "No files to update"

Copy link
Member

@Neylix Neylix left a comment

Choose a reason for hiding this comment

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

Didn't tested yet, put overall looks good, well done !
I have a suggestion, if a user delete files, they remain in the metada and so they are again added in the new reference transaction.
We may list all the files that have been passed throught the addFile function, and when we create the reference transaction we can check if there is file in metadata which are not in the file list, so we can delete them from the metadata.

@apoorv-2204 apoorv-2204 requested a review from Neylix February 1, 2023 06:52
@apoorv-2204
Copy link
Contributor Author

I tested 3 scenarios. 2/3 are successful.

  • ✔️ 1 file changed
  • ✔️ 2 files changed and 1 directory creation
  • 🔴 1 directory deletion

The 3rd scenario return "No files to update"

Hello.
I included support for deleted files, so the re tx will be updates if files are deleted.
Directory suppression is not handled as its not a file.

@samuelmanzanera
Copy link
Member

I tested 3 scenarios. 2/3 are successful.

  • ✔️ 1 file changed
  • ✔️ 2 files changed and 1 directory creation
  • 🔴 1 directory deletion

The 3rd scenario return "No files to update"

Hello. I included support for deleted files, so the re tx will be updates if files are deleted. Directory suppression is not handled as its not a file.

About the directory deletion, if the previous ref tx reported some files in the deleted directory, you should then remove the files of this given directory (like git is doing)

@apoorv-2204
Copy link
Contributor Author

I tested 3 scenarios. 2/3 are successful.

  • ✔️ 1 file changed
  • ✔️ 2 files changed and 1 directory creation
  • 🔴 1 directory deletion

The 3rd scenario return "No files to update"

Hello. I included support for deleted files, so the re tx will be updates if files are deleted. Directory suppression is not handled as its not a file.

About the directory deletion, if the previous ref tx reported some files in the deleted directory, you should then remove the files of this given directory (like git is doing)

Yes boss we are doing this.

@apoorv-2204
Copy link
Contributor Author

I tested 3 scenarios. 2/3 are successful.

  • ✔️ 1 file changed
  • ✔️ 2 files changed and 1 directory creation
  • 🔴 1 directory deletion

The 3rd scenario return "No files to update"

Hello. I included support for deleted files, so the re tx will be updates if files are deleted. Directory suppression is not handled as its not a file.

About the directory deletion, if the previous ref tx reported some files in the deleted directory, you should then remove the files of this given directory (like git is doing)

I mean, empty directory suppression, has no meaning, as it has no files. And for files in directory , if they are removed, they are removed from ref tx. Maybe you can give it a try?

@samuelmanzanera samuelmanzanera linked an issue Feb 2, 2023 that may be closed by this pull request
@Neylix Neylix merged commit b2c5250 into archethic-foundation:main Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature new feature or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle website update

4 participants