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

Create new IVT function to check if schema is the latest version #633

Open
maxsibilla opened this issue Jan 17, 2025 · 2 comments · May be fixed by #643
Open

Create new IVT function to check if schema is the latest version #633

maxsibilla opened this issue Jan 17, 2025 · 2 comments · May be fixed by #643
Assignees

Comments

@maxsibilla
Copy link
Contributor

maxsibilla commented Jan 17, 2025

What is needed is just a "true/false on whether it's the latest schema version being used".

Current check to determine the schema version is

iv_utils.get_schema_version(
    path=path,
    encoding="ascii",
    entity_url=f"{ensureTrailingSlashURL(current_app.config['ENTITY_WEBSERVICE_URL'])}entities/",
    ingest_url=ensureTrailingSlashURL(current_app.config["INGEST_URL"]),
    globus_token=token
).schema_name

to validate:

result = iv_utils.get_tsv_errors(
    path,
    schema_name=schema_name,
    report_type=table_validator.ReportType.JSON,
    globus_token=token,
    app_context=app_context,
)

We can create a new function that will return a boolean value if the given schema version (we might need to grab iv_utils.get_schema_version(...).version) is the latest.

iv_utils.is_schema_latest_version(
    path=path,
    schema_name=schema_name,
)

Related HM Ingest API PR - https://github.com/hubmapconsortium/ingest-api/pull/686/files

@maxsibilla maxsibilla added this to CODCC Jan 17, 2025
@maxsibilla maxsibilla converted this from a draft issue Jan 17, 2025
@maxsibilla
Copy link
Contributor Author

All flags we can potentially check for:

  • isLatestVersion
  • isLatestPublishedVersion
  • isLatestDraftVersion

@maxsibilla
Copy link
Contributor Author

Need to touch base with Joseph from CEDAR regarding which of the latest versions we should use (seems like isLatestVersion but that doesn't always line up with the published version)

libpitt added a commit that referenced this issue Jan 21, 2025
@maxsibilla maxsibilla moved this from Ready to In Progress in CODCC Jan 21, 2025
libpitt added a commit that referenced this issue Jan 22, 2025
@maxsibilla maxsibilla moved this from In Progress to Review/QA in CODCC Jan 24, 2025
libpitt added a commit that referenced this issue Jan 29, 2025
maxsibilla added a commit that referenced this issue Jan 29, 2025
@maxsibilla maxsibilla linked a pull request Jan 29, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Review/QA
Development

Successfully merging a pull request may close this issue.

2 participants