-
Notifications
You must be signed in to change notification settings - Fork 145
chore: inaccessible project IDs set to special private str #1981
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
Conversation
weave/trace_server/refs_internal.py
Outdated
|
|
||
| WEAVE_INTERNAL_SCHEME = "weave-trace-internal" | ||
| WEAVE_SCHEME = "weave" | ||
| PRIVATE_WEAVE_STR = "<private>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use something more distinct, for example <<PRIVATE_REF_DATA>>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wonder if we should do something like:
weave-private://///{rest} (yes, 5 slashes).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that would still meet our criteria of not being an official "ref", but also retain the "rest" component (name, version, etc...) if we did want to parse it in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I like it
|
Preview this PR with FeatureBee: https://beta.wandb.ai/?betaVersion=8f391ba766a0f2ac9c4f54ee0a0b4ca0a790d037 |
| export const isRef = (value: any): boolean => { | ||
| return ( | ||
| typeof value === 'string' && | ||
| (value.startsWith(WANDB_ARTIFACT_REF_PREFIX) || | ||
| value.startsWith(WEAVE_REF_PREFIX)) | ||
| ); | ||
| if (typeof value !== 'string') { | ||
| return false; | ||
| } | ||
| if (value.startsWith(WEAVE_REF_PREFIX_EMPTY)) { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not technically a ref, don't try to parse it
| export const emptyRefToSimpleName = (ref: string) => { | ||
| const trimmed = ref.replace(WEAVE_REF_PREFIX_EMPTY, ''); | ||
| try { | ||
| return trimmed.split('/')[1].split(':')[0]; | ||
| } catch (e) { | ||
| return trimmed; | ||
| } | ||
| }; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simple parse for our empty ref that goes from the fake URI to just the object_id
| req.project_id = self._idc.ext_to_int_project_id(original_project_id) | ||
| res = self._ref_apply(self._internal_trace_server.ops_query, req) | ||
| for op in res.ops: | ||
| for op in res.op_objs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was getting type errors here, but i dont understand how this is working...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
we don't implement these on server so no one every hit them
| ) | ||
| external_project_id = int_to_ext_project_cache[project_id] | ||
| if not external_project_id: | ||
| return f"{ri.WEAVE_PRIVATE_SCHEME}://///{tail}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty entity/project
should fix: https://wandb.atlassian.net/browse/WB-19245
depends on: https://github.com/wandb/core/pull/22755
This pr:
NoneWe display the string, as it becomes the
op_name. We can either handle that case specially in the frontend, or choose this string discerningly.