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

split gomockhandler.json into configuration file and mocks status file #74

Open
sanposhiho opened this issue Nov 12, 2021 · 5 comments
Open
Assignees

Comments

@sanposhiho
Copy link
Owner

sanposhiho commented Nov 12, 2021

from #59

Let's move source_checksum and checksum from gomockhandler.json to new 'mocks status file'.

with this

  • we can make configuration file more readable
  • we can allow user to edit configuration file directly
@sanposhiho sanposhiho self-assigned this Nov 12, 2021
@riita10069
Copy link
Contributor

Hi! @sanposhiho
Does this Proposal maintain downward compatibility with existing projects?

@sanposhiho
Copy link
Owner Author

sanposhiho commented Nov 23, 2021

Maybe yes.
I think we can achieve this without breaking existing projects. But it's possible we'll find out that we can't during developing this feature.

my plan:
In order not to break existing projects, when we use mock status(= source_checksum and checksum) in each command,

  • basically, we check the new mocks status file and use mock status in it
  • and we also check source_checksum and checksum on gomockhandler.json
  • and if we find them on gomockhandler.json, we move them to the new mocks status file.
  • and then, delete them from gomockhandler.json.

This means that the gomockhandler.json is allowed to have source_checksum and checksum and they will be automatically moved to the new mocks status file.
And when we release v2, we can delete source_checksum and checksum from gomockhandler.json.

wdyt?

@riita10069
Copy link
Contributor

I think we must consider some situations about Coexistence.
if it fouund new mock status file, but gomockhandler.json has mock status too.
Can it recognize the gomockhandler.json's mock status?

and if new mock status file and gomockhandler.json has different value of checksum as to same source.
what should it behave?

A person who somehow upgraded its version will run a new command without realizing that the json file has been split.

@sanposhiho
Copy link
Owner Author

sanposhiho commented Nov 23, 2021

if new mock status file and gomockhandler.json has different value of checksum as to same source.
what should it behave?

The checksum on new mock status file should take precedence. And the one on gomockhandler.json will be deleted at that time.

Basically, we should consider backward compatibility when we increment minor versions, but don't always need to forward compatibility including what happens when a project has both people using the old version and people using the new version.

Users on the same project should use the same version of tools ideally.

@riita10069
Copy link
Contributor

I understand.
So it always works to converge to a newer version of json. Including existing files.
Thanks for the reply.

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

No branches or pull requests

2 participants