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

Garble cherry pick #47

Closed
wants to merge 4 commits into from
Closed

Garble cherry pick #47

wants to merge 4 commits into from

Conversation

jsrockhill
Copy link
Collaborator

@jsrockhill jsrockhill commented Nov 29, 2022

Adds "garble_time" field to metadata file both kept by data owner and sent to linkage agent.

For ticket No. 183864643

@jsrockhill jsrockhill changed the title Garble cherry pick draft: Garble cherry pick Nov 29, 2022
@jsrockhill jsrockhill marked this pull request as draft November 29, 2022 16:40
@jsrockhill jsrockhill changed the title draft: Garble cherry pick Garble cherry pick Nov 29, 2022
@jsrockhill jsrockhill marked this pull request as ready for review November 29, 2022 16:44
Comment on lines +116 to +117
with open(metadata_file, "w") as original_metafile:
json.dump(metadata, original_metafile, indent=2)
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 the critical piece here -- not sure why the other changes were made, it seems like renaming the other files breaks in linkage-agent-tools. Can you revert the other changes and just do this? Or help me understand what the other changes are needed for

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@dehall The other changes are changes we'd have to make in anticipation of merging PR #32 in linkage-agent-tools. Those changes have been present as a part of this PR since before it was cherry-picked into a new PR but I'm not sure if there is any discussion there about them. Either way, they won't break linkage-agent-tools once This PR is merged

Copy link
Collaborator

@dehall dehall Dec 8, 2022

Choose a reason for hiding this comment

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

When I try with this branch on data-owner-tools and that branch on linkage-agent-tools I still get errors, related to the metadata file name in validate.py:

$ py validate.py
site_a.zip
Traceback (most recent call last):
  File "/Users/dehall/linkage-agent-tools/validate.py", line 67, in <module>
    do_validate(config)
  File "/Users/dehall/linkage-agent-tools/validate.py", line 23, in do_validate
    missing, unexpected, metadata_issues = c.validate_all_present()
  File "/Users/dehall/linkage-agent-tools/dcctools/config.py", line 129, in validate_all_present
    metadata_issues.extend(self.validate_metadata(system_zip_path))
  File "/Users/dehall/linkage-agent-tools/dcctools/config.py", line 59, in validate_metadata
    timestamp = datetime.strptime(mname, "%Y%m%dT%H%M%S")
  File "/usr/local/Cellar/[email protected]/3.9.2_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/usr/local/Cellar/[email protected]/3.9.2_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '' does not match format '%Y%m%dT%H%M%S'

And in projects.py, I believe this is because the clk file name format doesn't match what's expected:

$ py projects.py
Traceback (most recent call last):
  File "/Users/dehall/linkage-agent-tools/projects.py", line 120, in <module>
    run_projects(config, args.project)
  File "/Users/dehall/linkage-agent-tools/projects.py", line 61, in run_projects
    run_project(c, timestamp, project_name)
  File "/Users/dehall/linkage-agent-tools/projects.py", line 87, in run_project
    project.upload_clks(system, c.get_clks_raw(system, project_name))
  File "/Users/dehall/linkage-agent-tools/dcctools/config.py", line 221, in get_clks_raw
    with clk_zip.open(project_file) as clk_file:
UnboundLocalError: local variable 'project_file' referenced before assignment

Rather than try to solve all these together, let's just do one piece at a time, so for this PR let's just keep the necessary snippet and revisit the rest separately.

@jsrockhill jsrockhill marked this pull request as draft December 13, 2022 15:04
@jsrockhill jsrockhill closed this Dec 13, 2022
@dehall dehall deleted the garble-cherry-pick branch January 12, 2023 16:04
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.

2 participants