Skip to content

Commit 00341df

Browse files
authored
DOP-2243: remove published branches logic (#330)
1 parent 98c5f49 commit 00341df

File tree

5 files changed

+2
-158
lines changed

5 files changed

+2
-158
lines changed

snooty/gizaparser/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from . import extracts, published_branches, release, steps
1+
from . import extracts, release, steps
22

3-
__all__ = ["steps", "extracts", "release", "published_branches"]
3+
__all__ = ["steps", "extracts", "release"]

snooty/gizaparser/published_branches.py

Lines changed: 0 additions & 90 deletions
This file was deleted.

snooty/parser.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
UnknownTabset,
6565
)
6666
from .gizaparser.nodes import GizaCategory
67-
from .gizaparser.published_branches import PublishedBranches, parse_published_branches
6867
from .openapi import OpenAPI
6968
from .page import Page, PendingTask
7069
from .postprocess import DevhubPostprocessor, Postprocessor, PostprocessorResult
@@ -1466,36 +1465,6 @@ def __init__(
14661465
self.asset_dg: "networkx.DiGraph[FileId]" = networkx.DiGraph()
14671466
self.expensive_operation_cache: Cache[FileId] = Cache()
14681467

1469-
published_branches, published_branches_diagnostics = self.get_parsed_branches()
1470-
with self._backend_lock:
1471-
if published_branches:
1472-
self.backend.on_update_metadata(
1473-
self.prefix,
1474-
self.build_identifiers,
1475-
{"publishedBranches": published_branches.serialize()},
1476-
)
1477-
1478-
if published_branches_diagnostics:
1479-
self.initialization_diagnostics[snooty_config_fileid].extend(
1480-
published_branches_diagnostics
1481-
)
1482-
backend.on_diagnostics(
1483-
self.config.get_fileid(self.config.config_path),
1484-
published_branches_diagnostics,
1485-
)
1486-
1487-
def get_parsed_branches(
1488-
self,
1489-
) -> Tuple[Optional[PublishedBranches], List[Diagnostic]]:
1490-
try:
1491-
path = self.config.root
1492-
return parse_published_branches(
1493-
path.joinpath("published-branches.yaml"), self.config
1494-
)
1495-
except FileNotFoundError:
1496-
pass
1497-
return None, []
1498-
14991468
def get_full_path(self, fileid: FileId) -> Path:
15001469
return self.config.source_path.joinpath(fileid)
15011470

snooty/test_project.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -112,23 +112,6 @@ def test() -> None:
112112
# Ensure that the page has been reparsed 2 times
113113
assert backend.updates == [index_id, index_id]
114114

115-
# Ensure that published-branches.yaml has been parsed
116-
(
117-
published_branches,
118-
published_branch_diagnostics,
119-
) = project._project.get_parsed_branches()
120-
assert len(published_branch_diagnostics) == 0
121-
assert project.config.title == "MongoDB title"
122-
assert published_branches and published_branches.serialize() == {
123-
"git": {"branches": {"manual": "master", "published": ["master", "v1.0"]}},
124-
"version": {
125-
"published": ["1.1", "1.0"],
126-
"active": ["1.1", "1.0"],
127-
"stable": None,
128-
"upcoming": None,
129-
},
130-
}
131-
132115
# Ensure that any filesystem monitoring threads have been shut down
133116
assert len(threading.enumerate()) == n_threads
134117

test_data/test_project/published-branches.yaml

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)