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

Removal of TreeEntry.Commit and ISnapshotTree.commit #9520

Merged
merged 6 commits into from
Mar 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions BREAKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ There are a few steps you can take to write a good change note and avoid needing
- Provide guidance on how the change should be consumed if applicable, such as by specifying replacement APIs.
- Consider providing code examples as part of guidance for non-trivial changes.

# 0.59

## 0.59 Upcoming changes

## 0.59 Breaking changes
- [Removing Commit from TreeEntry and commits from SnapShotTree](#Removing-Commit-from-TreeEntry-and-commits-from-SnapShotTree)


### Removing Commit from TreeEntry and commits from SnapShotTree
Cleaning up properties that are not being used in the codebase: `TreeEntry.Commit` and `ISnapshotTree.commits`.
Copy link
Contributor

@heliocliu heliocliu Mar 17, 2022

Choose a reason for hiding this comment

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

Suggested change
Cleaning up properties that are not being used in the codebase: `TreeEntry.Commit` and `ISnapshotTree.commits`.
Cleaning up properties that are not being used in the codebase: `TreeEntry.Commit` and `ISnapshotTree.commits`. These should not be used and there is no replacement provided.

if there is intentionally no replacement this may be worth calling out just in case, but up to you. #Resolved

These should not be used and there is no replacement provided.


# 0.58

## 0.58 Upcoming changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ export type ConnectionMode = "write" | "read";

// @public (undocumented)
export enum FileMode {
// (undocumented)
Commit = "160000",
// (undocumented)
Directory = "040000",
// (undocumented)
Expand Down Expand Up @@ -379,10 +377,6 @@ export interface ISnapshotTree {
[path: string]: string;
};
// (undocumented)
commits: {
[path: string]: string;
};
// (undocumented)
id?: string;
// (undocumented)
trees: {
Expand Down Expand Up @@ -576,9 +570,6 @@ export type ITreeEntry = {
} & ({
type: TreeEntry.Blob;
value: IBlob;
} | {
type: TreeEntry.Commit;
value: string;
} | {
type: TreeEntry.Tree;
value: ITree;
Expand Down Expand Up @@ -700,8 +691,6 @@ export enum TreeEntry {
// (undocumented)
Blob = "Blob",
// (undocumented)
Commit = "Commit",
// (undocumented)
Tree = "Tree"
}

Expand Down
68 changes: 68 additions & 0 deletions common/lib/protocol-definitions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,18 @@
"RemovedInterfaceDeclaration_IPendingProposal": {
"backCompat": false,
"forwardCompat": false
},
"InterfaceDeclaration_ISnapshotTree": {
"backCompat": false
},
"InterfaceDeclaration_ISnapshotTreeEx": {
"backCompat": false
},
"EnumDeclaration_TreeEntry": {
"forwardCompat": false
},
"EnumDeclaration_FileMode": {
"forwardCompat": false
}
},
"0.1025.1": {
Expand All @@ -121,6 +133,24 @@
},
"InterfaceDeclaration_IQuorumProposals": {
"backCompat": false
},
"InterfaceDeclaration_ISnapshotTree": {
"backCompat": false
},
"InterfaceDeclaration_ISnapshotTreeEx": {
"backCompat": false
},
"EnumDeclaration_TreeEntry": {
"forwardCompat": false
},
"InterfaceDeclaration_ITree": {
"forwardCompat": false
},
"TypeAliasDeclaration_ITreeEntry": {
"forwardCompat": false
},
"EnumDeclaration_FileMode": {
"forwardCompat": false
}
},
"0.1026.0": {
Expand All @@ -142,6 +172,44 @@
},
"InterfaceDeclaration_IQuorumProposals": {
"backCompat": false
},
"InterfaceDeclaration_ISnapshotTree": {
"backCompat": false
},
"InterfaceDeclaration_ISnapshotTreeEx": {
"backCompat": false
},
"EnumDeclaration_TreeEntry": {
"forwardCompat": false
},
"InterfaceDeclaration_ITree": {
"forwardCompat": false
},
"TypeAliasDeclaration_ITreeEntry": {
"forwardCompat": false
},
"EnumDeclaration_FileMode": {
"forwardCompat": false
}
},
"0.1027.0": {
"InterfaceDeclaration_ISnapshotTree": {
"backCompat": false
},
"InterfaceDeclaration_ISnapshotTreeEx": {
"backCompat": false
},
"EnumDeclaration_TreeEntry": {
"forwardCompat": false
},
"InterfaceDeclaration_ITree": {
"forwardCompat": false
},
"TypeAliasDeclaration_ITreeEntry": {
"forwardCompat": false
},
"EnumDeclaration_FileMode": {
"forwardCompat": false
}
}
}
Expand Down
11 changes: 2 additions & 9 deletions common/lib/protocol-definitions/src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export enum FileMode {
File = "100644",
Executable = "100755",
Directory = "040000",
Commit = "160000",
Symlink = "120000",
}

Expand Down Expand Up @@ -53,16 +52,13 @@ export interface ICreateBlobResponse {
export type ITreeEntry = {
// Path to the object
path: string;
// The file mode; one of 100644 for file (blob), 100755 for executable (blob), 040000 for subdirectory (tree),
// 160000 for submodule (commit), or 120000 for a blob that specifies the path of a symlink
// The file mode; one of 100644 for file (blob), 100755 for executable (blob), 040000 for subdirectory (tree)
// or 120000 for a blob that specifies the path of a symlink
mode: FileMode;
} & (
{
type: TreeEntry.Blob;
value: IBlob;
} | {
type: TreeEntry.Commit;
value: string;
} | {
type: TreeEntry.Tree;
value: ITree;
Expand All @@ -76,7 +72,6 @@ export type ITreeEntry = {
*/
export enum TreeEntry {
Blob = "Blob",
Commit = "Commit",
Tree = "Tree",
Attachment = "Attachment",
}
Expand All @@ -93,8 +88,6 @@ export interface ITree {
export interface ISnapshotTree {
id?: string;
blobs: { [path: string]: string };
// TODO: Commits should be removed from here to ISnapshotTreeEx once ODSP snapshots move away from commits
commits: { [path: string]: string };
trees: { [path: string]: ISnapshotTree };
// Indicates that this tree is unreferenced. If this is not present, the tree is considered referenced.
unreferenced?: true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ declare function get_old_EnumDeclaration_FileMode():
declare function use_current_EnumDeclaration_FileMode(
use: current.FileMode);
use_current_EnumDeclaration_FileMode(
// @ts-expect-error compatibility expected to be broken
get_old_EnumDeclaration_FileMode());

/*
Expand Down Expand Up @@ -926,6 +927,7 @@ declare function get_current_InterfaceDeclaration_ISnapshotTree():
declare function use_old_InterfaceDeclaration_ISnapshotTree(
use: old.ISnapshotTree);
use_old_InterfaceDeclaration_ISnapshotTree(
// @ts-expect-error compatibility expected to be broken
get_current_InterfaceDeclaration_ISnapshotTree());

/*
Expand All @@ -950,6 +952,7 @@ declare function get_current_InterfaceDeclaration_ISnapshotTreeEx():
declare function use_old_InterfaceDeclaration_ISnapshotTreeEx(
use: old.ISnapshotTreeEx);
use_old_InterfaceDeclaration_ISnapshotTreeEx(
// @ts-expect-error compatibility expected to be broken
get_current_InterfaceDeclaration_ISnapshotTreeEx());

/*
Expand Down Expand Up @@ -1638,6 +1641,7 @@ declare function get_old_EnumDeclaration_TreeEntry():
declare function use_current_EnumDeclaration_TreeEntry(
use: current.TreeEntry);
use_current_EnumDeclaration_TreeEntry(
// @ts-expect-error compatibility expected to be broken
get_old_EnumDeclaration_TreeEntry());

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ declare function get_old_EnumDeclaration_FileMode():
declare function use_current_EnumDeclaration_FileMode(
use: current.FileMode);
use_current_EnumDeclaration_FileMode(
// @ts-expect-error compatibility expected to be broken
get_old_EnumDeclaration_FileMode());

/*
Expand Down Expand Up @@ -1021,6 +1022,7 @@ declare function get_current_InterfaceDeclaration_ISnapshotTree():
declare function use_old_InterfaceDeclaration_ISnapshotTree(
use: old.ISnapshotTree);
use_old_InterfaceDeclaration_ISnapshotTree(
// @ts-expect-error compatibility expected to be broken
get_current_InterfaceDeclaration_ISnapshotTree());

/*
Expand All @@ -1045,6 +1047,7 @@ declare function get_current_InterfaceDeclaration_ISnapshotTreeEx():
declare function use_old_InterfaceDeclaration_ISnapshotTreeEx(
use: old.ISnapshotTreeEx);
use_old_InterfaceDeclaration_ISnapshotTreeEx(
// @ts-expect-error compatibility expected to be broken
get_current_InterfaceDeclaration_ISnapshotTreeEx());

/*
Expand Down Expand Up @@ -1442,6 +1445,7 @@ declare function get_old_InterfaceDeclaration_ITree():
declare function use_current_InterfaceDeclaration_ITree(
use: current.ITree);
use_current_InterfaceDeclaration_ITree(
// @ts-expect-error compatibility expected to be broken
get_old_InterfaceDeclaration_ITree());

/*
Expand All @@ -1466,6 +1470,7 @@ declare function get_old_TypeAliasDeclaration_ITreeEntry():
declare function use_current_TypeAliasDeclaration_ITreeEntry(
use: current.ITreeEntry);
use_current_TypeAliasDeclaration_ITreeEntry(
// @ts-expect-error compatibility expected to be broken
get_old_TypeAliasDeclaration_ITreeEntry());

/*
Expand Down Expand Up @@ -1731,6 +1736,7 @@ declare function get_old_EnumDeclaration_TreeEntry():
declare function use_current_EnumDeclaration_TreeEntry(
use: current.TreeEntry);
use_current_EnumDeclaration_TreeEntry(
// @ts-expect-error compatibility expected to be broken
get_old_EnumDeclaration_TreeEntry());

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ declare function get_old_EnumDeclaration_FileMode():
declare function use_current_EnumDeclaration_FileMode(
use: current.FileMode);
use_current_EnumDeclaration_FileMode(
// @ts-expect-error compatibility expected to be broken
get_old_EnumDeclaration_FileMode());

/*
Expand Down Expand Up @@ -1020,6 +1021,7 @@ declare function get_current_InterfaceDeclaration_ISnapshotTree():
declare function use_old_InterfaceDeclaration_ISnapshotTree(
use: old.ISnapshotTree);
use_old_InterfaceDeclaration_ISnapshotTree(
// @ts-expect-error compatibility expected to be broken
get_current_InterfaceDeclaration_ISnapshotTree());

/*
Expand All @@ -1044,6 +1046,7 @@ declare function get_current_InterfaceDeclaration_ISnapshotTreeEx():
declare function use_old_InterfaceDeclaration_ISnapshotTreeEx(
use: old.ISnapshotTreeEx);
use_old_InterfaceDeclaration_ISnapshotTreeEx(
// @ts-expect-error compatibility expected to be broken
get_current_InterfaceDeclaration_ISnapshotTreeEx());

/*
Expand Down Expand Up @@ -1441,6 +1444,7 @@ declare function get_old_InterfaceDeclaration_ITree():
declare function use_current_InterfaceDeclaration_ITree(
use: current.ITree);
use_current_InterfaceDeclaration_ITree(
// @ts-expect-error compatibility expected to be broken
get_old_InterfaceDeclaration_ITree());

/*
Expand All @@ -1465,6 +1469,7 @@ declare function get_old_TypeAliasDeclaration_ITreeEntry():
declare function use_current_TypeAliasDeclaration_ITreeEntry(
use: current.ITreeEntry);
use_current_TypeAliasDeclaration_ITreeEntry(
// @ts-expect-error compatibility expected to be broken
get_old_TypeAliasDeclaration_ITreeEntry());

/*
Expand Down Expand Up @@ -1922,6 +1927,7 @@ declare function get_old_EnumDeclaration_TreeEntry():
declare function use_current_EnumDeclaration_TreeEntry(
use: current.TreeEntry);
use_current_EnumDeclaration_TreeEntry(
// @ts-expect-error compatibility expected to be broken
get_old_EnumDeclaration_TreeEntry());

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ declare function get_old_EnumDeclaration_FileMode():
declare function use_current_EnumDeclaration_FileMode(
use: current.FileMode);
use_current_EnumDeclaration_FileMode(
// @ts-expect-error compatibility expected to be broken
get_old_EnumDeclaration_FileMode());

/*
Expand Down Expand Up @@ -991,6 +992,7 @@ declare function get_current_InterfaceDeclaration_ISnapshotTree():
declare function use_old_InterfaceDeclaration_ISnapshotTree(
use: old.ISnapshotTree);
use_old_InterfaceDeclaration_ISnapshotTree(
// @ts-expect-error compatibility expected to be broken
get_current_InterfaceDeclaration_ISnapshotTree());

/*
Expand All @@ -1015,6 +1017,7 @@ declare function get_current_InterfaceDeclaration_ISnapshotTreeEx():
declare function use_old_InterfaceDeclaration_ISnapshotTreeEx(
use: old.ISnapshotTreeEx);
use_old_InterfaceDeclaration_ISnapshotTreeEx(
// @ts-expect-error compatibility expected to be broken
get_current_InterfaceDeclaration_ISnapshotTreeEx());

/*
Expand Down Expand Up @@ -1411,6 +1414,7 @@ declare function get_old_InterfaceDeclaration_ITree():
declare function use_current_InterfaceDeclaration_ITree(
use: current.ITree);
use_current_InterfaceDeclaration_ITree(
// @ts-expect-error compatibility expected to be broken
get_old_InterfaceDeclaration_ITree());

/*
Expand All @@ -1435,6 +1439,7 @@ declare function get_old_TypeAliasDeclaration_ITreeEntry():
declare function use_current_TypeAliasDeclaration_ITreeEntry(
use: current.ITreeEntry);
use_current_TypeAliasDeclaration_ITreeEntry(
// @ts-expect-error compatibility expected to be broken
get_old_TypeAliasDeclaration_ITreeEntry());

/*
Expand Down Expand Up @@ -1891,6 +1896,7 @@ declare function get_old_EnumDeclaration_TreeEntry():
declare function use_current_EnumDeclaration_TreeEntry(
use: current.TreeEntry);
use_current_EnumDeclaration_TreeEntry(
// @ts-expect-error compatibility expected to be broken
get_old_EnumDeclaration_TreeEntry());

/*
Expand Down