Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
9059c99
Sort by number of matching terms
forsyth2 Apr 1, 2026
39d6056
Combine output for e3sm.org and Confluence
forsyth2 Apr 1, 2026
358eef2
Improvements to term-reviewer
forsyth2 Apr 8, 2026
a0547da
Add created dates to website-reviewer output
forsyth2 Apr 8, 2026
21cba16
Have term-reviewer sort by year
forsyth2 Apr 8, 2026
d264e82
Add descriptions to term-reviewer output
forsyth2 Apr 8, 2026
5407ece
Add summary tables to term-reviewer output
forsyth2 Apr 8, 2026
64412c2
Get row and col to show up
forsyth2 Apr 8, 2026
812ac75
Add website link status
forsyth2 May 4, 2026
fbd3eb7
Add checks for archived pages
forsyth2 May 4, 2026
d5ef251
Update print lines in e3sm org reviewer
forsyth2 May 4, 2026
8bf4051
Share the archived web pages input
forsyth2 May 4, 2026
04bdb1a
AI-generated addition of Archived section
forsyth2 May 4, 2026
0f8bd74
Add example script and update README
forsyth2 May 4, 2026
56cc0ab
AI-generated check for manually reviewed pages
forsyth2 May 4, 2026
86127cc
Update README for manually reviewed input file
forsyth2 May 4, 2026
6007e55
Convert manual review check from Confluence to e3sm.org
forsyth2 May 4, 2026
704317b
AI replace IGNORED with KNOWN OK and DOES NOT EXIST
forsyth2 May 4, 2026
667c857
Update README
forsyth2 May 4, 2026
679d9b2
Update labels
forsyth2 May 5, 2026
9d774f6
AI generated add keep-unchanged bucket
forsyth2 May 5, 2026
5c4e255
Update README
forsyth2 May 5, 2026
9b1fd30
Produce lists of all WordPress pages and posts
forsyth2 May 7, 2026
908d3bd
Add more filtering of e3sm.org paths
forsyth2 May 7, 2026
5709c63
Change output to Markdown report
forsyth2 May 7, 2026
68227b7
Add summary table to Markdown report
forsyth2 May 7, 2026
4e65131
Add total col to summary table
forsyth2 May 7, 2026
2d99f9b
Handle expandable patterns
forsyth2 May 7, 2026
df00e12
Add Confluence URL handling
forsyth2 May 7, 2026
84f4b6e
Add Confluence mapping summary
forsyth2 May 7, 2026
4cc8a48
Add validation to Confluence summary
forsyth2 May 7, 2026
514b735
Fix errors that were causing page skips
forsyth2 May 7, 2026
0b3809e
Update bash script
forsyth2 May 7, 2026
2629f06
Make term reviewer part of e3sm.org reviewer
forsyth2 May 7, 2026
b2e6370
Add action items Markdown
forsyth2 May 7, 2026
14ce477
Improvements to action items reporting
forsyth2 May 7, 2026
771147d
Fully remove term-reviewer
forsyth2 May 7, 2026
2849336
Fix whitelist URL count
forsyth2 May 7, 2026
5a196ee
Add exported-xml-reviewer
forsyth2 May 8, 2026
a360f55
Improve xml-reviewer output
forsyth2 May 8, 2026
8fdb757
Successful Markdown report from xml-reviewer
forsyth2 May 8, 2026
f254832
Add requested links section
forsyth2 May 15, 2026
c7de3a2
Minor improvements
forsyth2 May 15, 2026
4244b0a
Improve requested_links section
forsyth2 May 15, 2026
d5bc100
Sort requested links
forsyth2 May 15, 2026
eac1a7d
Update run script
forsyth2 May 19, 2026
72af824
Add outline of WordPress pages
forsyth2 May 21, 2026
9d01f82
Add status to WordPress outline
forsyth2 May 21, 2026
15ca65a
Add known ok links section
forsyth2 May 21, 2026
2e52730
Add navigation report
forsyth2 May 21, 2026
3047d41
Sort navigation report
forsyth2 May 21, 2026
320b2c5
Add invalid link report
forsyth2 May 22, 2026
21e1110
Filter the invalid links report
forsyth2 May 22, 2026
bbfeb69
Improve inference rules for link redirection
forsyth2 May 22, 2026
811c407
Add guessed link column
forsyth2 May 22, 2026
43cb4d9
Sort by inference type
forsyth2 May 22, 2026
d289d32
Add status column
forsyth2 May 22, 2026
00b1ab0
Clean up invalid links report
forsyth2 May 22, 2026
7ec059b
Make Confluence and whitelist inputs optional
forsyth2 May 22, 2026
c1bd8e2
Add link checking
forsyth2 May 22, 2026
eeea9c6
Revise inference rules
forsyth2 May 22, 2026
251edae
Make distinct tables
forsyth2 May 22, 2026
d32aa18
Fix status check
forsyth2 May 22, 2026
b819292
Add section for archived links
forsyth2 May 22, 2026
319ec7e
Add section counts and split references column
forsyth2 May 22, 2026
e190b24
Add published page link report
forsyth2 May 27, 2026
72d4799
Add valid link count
forsyth2 May 27, 2026
20c8a66
Display pages with invalid links first
forsyth2 May 27, 2026
3133503
Add column totals
forsyth2 May 27, 2026
8e40280
Add posts
forsyth2 May 27, 2026
42d6888
Address comments
forsyth2 Jun 1, 2026
d3ce206
Break exported_xml_reviewer into multiple files
forsyth2 Jun 1, 2026
0968229
Rename report
forsyth2 Jun 1, 2026
2743ea5
Add flags for optional inputs
forsyth2 Jun 1, 2026
8aec40f
Break e3sm_org_reviewer into multiple files
forsyth2 Jun 1, 2026
223f226
Update example scripts
forsyth2 Jun 1, 2026
782b1f3
Factor out common code
forsyth2 Jun 2, 2026
26a2c95
Claude-generated code to check external links
forsyth2 Jun 24, 2026
23708b3
Add comment explaining inputs
forsyth2 Jun 24, 2026
5d147f4
Fix link extraction
forsyth2 Jun 24, 2026
40dab1f
Claude-generated code to skip known inaccessible links
forsyth2 Jun 25, 2026
faa7ca8
Update docs for external links report
forsyth2 Jun 25, 2026
0d3938c
Update inaccessible link description
forsyth2 Jun 25, 2026
5198968
Address Copilot review comments
forsyth2 Jul 2, 2026
8512e8c
Port remaining e3sm_org_reviewer checks into exported_xml_reviewer
forsyth2 Aug 11, 2026
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
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ This package is for implementing the software needs of the E3SM Communications t
### Simple commands

`e3sm-comms-e3sm-org-reviewer`
- input: txt file listing e3sm.org pages to review, txt file containing phrases to search for
- output: txt file listing e3sm.org pages containing those phrases
- input:
- From WordPress under Tools > Export: xml file of WordPress pages, xml file of WordPress posts. Note: your export will go to your local machine. Example transfer command: `scp local_path/wordpress_posts.xml user@host:/remote/path/wordpress_posts.xml`.
- From output of `e3sm-comms-website-reviewer`: txt file of hierarchical outline of Confluence pages, txt file of sensitive terms found on Confluence pages
- Other: txt file of whitelisted e3sm.org pages, txt file of e3sm.org pages expected to be archived, txt file of sensitive terms, txt file of known-ok e3sm.org pages (that is, script is picking up errors we don't care about), txt file of keep-unchanged e3sm.org pages (that is, pages we don't want to change)
- output: 3 Markdown summary reports: (1) An analysis of the e3sm.org paths, (2) An analysis of the sensitive terms found, (3) the key action items

`e3sm-comms-html-reviewer`
- input: 1 txt file of html copied from WordPress that includes yellow highlights left over from Confluence.
Expand All @@ -23,6 +26,13 @@ This package is for implementing the software needs of the E3SM Communications t
- input: txt file of time intervals to cut from the video, txt file of initial timestamps
- output: txt file of new timestamps after cutting the specified intervals

`e3sm-comms-exported-xml-reviewer`
- input:
- From WordPress under Tools > Export: xml file of WordPress pages, xml file of WordPress posts. NOTE: Only ever use the XML files downloaded directly from WordPress; the source must be trusted.
- From output of `e3sm-comms-website-reviewer`: txt file of hierarchical outline of Confluence pages
- Other: txt file of sensitive terms, txt file of whitelisted e3sm.org pages, txt file of links known to be inaccessible for automated review
- output: 6 files under `output/exported_xml_reviewer/`: (1) `wordpress_sensitive_terms_report.md`, (2) `wordpress_hierarchical_outline.txt`, (3) `wordpress_navigation_issues_report.md`, (4) `wordpress_invalid_internal_links_report.md`, (5) `wordpress_published_pages_link_report.md`, (6) `wordpress_invalid_external_links_report.md`

### Confluence API commands (require Confluence token)

`e3sm-comms-newsletter-reviewer`
Expand Down
8 changes: 8 additions & 0 deletions e3sm_comms/e3sm_org_reviewer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Dependency hierarchy

It is important to not introduce circular dependencies.
To avoid this, the dependency hierarchy is listed below:

- Level 1: `main.py`
- Level 2: `parsers.py`, `reporters.py`
- Level 3: `classifiers.py`, `confluence.py`, `readers.py`, `record.py`, `utils.py`
81 changes: 81 additions & 0 deletions e3sm_comms/e3sm_org_reviewer/classifiers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import re
from typing import Dict, Optional, Set, Tuple

CLASS_PUBLISHED = "Published"
CLASS_ARCHIVED = "Archived"
CLASS_SHOULD_BE_ARCHIVED = "Should be archived"
CLASS_NOT_PUBLISHED = "Not published"
CLASS_KNOWN_OK = "Known OK"
CLASS_KEEP_UNCHANGED = "Keep unchanged"
CLASS_NO_MAPPED_E3SM_URL = "No mapped e3sm.org URL"
CLASS_PREDICTED_URL_NOT_IN_EXPORT = "Predicted e3sm.org URL not in WordPress export"

FROM_PREFIX_RE = re.compile(r"^\[From\s+(\d{4})-\d{2}-\d{2}T[^\]]+\]\s*(.*)$")


def classify_e3sm_url(
e3sm_url: Optional[str],
url_to_status: Dict[str, str],
expected_archived_urls: Set[str],
known_ok_urls: Set[str],
keep_unchanged_urls: Set[str],
) -> Tuple[str, Optional[str]]:
if not e3sm_url:
return CLASS_NO_MAPPED_E3SM_URL, None

if e3sm_url in known_ok_urls:
return CLASS_KNOWN_OK, url_to_status.get(e3sm_url)

if e3sm_url in keep_unchanged_urls:
return CLASS_KEEP_UNCHANGED, url_to_status.get(e3sm_url)

wordpress_status = url_to_status.get(e3sm_url)

if wordpress_status is None:
return CLASS_PREDICTED_URL_NOT_IN_EXPORT, None

if wordpress_status == "archive":
return CLASS_ARCHIVED, wordpress_status

if e3sm_url in expected_archived_urls:
return CLASS_SHOULD_BE_ARCHIVED, wordpress_status

if wordpress_status != "publish":
return CLASS_NOT_PUBLISHED, wordpress_status

return CLASS_PUBLISHED, wordpress_status


def classification_sort_key(classification: str) -> Tuple[int, str]:
order = {
CLASS_PUBLISHED: 0,
CLASS_SHOULD_BE_ARCHIVED: 1,
CLASS_ARCHIVED: 2,
CLASS_NOT_PUBLISHED: 3,
CLASS_KNOWN_OK: 4,
CLASS_KEEP_UNCHANGED: 5,
CLASS_NO_MAPPED_E3SM_URL: 6,
CLASS_PREDICTED_URL_NOT_IN_EXPORT: 7,
}
return (order.get(classification, 999), classification)


def year_sort_key(year_str: str) -> Tuple[int, int]:
if year_str == "Unknown year":
return (1, 0)
if year_str == "N/A":
return (2, 0)
try:
return (0, -int(year_str))
except ValueError:
return (3, 0)


def extract_year_and_remainder(line: str) -> Tuple[Optional[int], str]:
match = FROM_PREFIX_RE.match(line)
if not match:
return None, line

year = int(match.group(1))
remainder = match.group(2).strip()
return year, remainder
34 changes: 34 additions & 0 deletions e3sm_comms/e3sm_org_reviewer/confluence.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from typing import List, Tuple

from e3sm_comms.page_reviewer.utils_base import map_confluence_to_e3sm
from e3sm_comms.utils import parse_confluence_hierarchy_file

CONFLUENCE_SPACE = "EPWCD"
CONFLUENCE_BASE = "https://e3sm.atlassian.net/wiki"


def build_confluence_url(page_id: str, space_key: str = CONFLUENCE_SPACE) -> str:
return f"{CONFLUENCE_BASE}/spaces/{space_key}/pages/{page_id}"


def get_confluence_predicted_e3sm_urls(
input_file: str,
) -> Tuple[List[str], List[str]]:
valid_predicted_urls: List[str] = []
unmapped_confluence_pages: List[str] = []

for page_id, title in parse_confluence_hierarchy_file(input_file):
confluence_url = build_confluence_url(page_id)
try:
e3sm_url = map_confluence_to_e3sm(confluence_url, page_title=title)
if e3sm_url:
valid_predicted_urls.append(e3sm_url)
else:
unmapped_confluence_pages.append(f"{title}: {confluence_url}")
except Exception as exc:
print(
f"Could not map Confluence URL to e3sm.org URL for {confluence_url}: {exc}"
)
unmapped_confluence_pages.append(f"{title}: {confluence_url}")

return sorted(set(valid_predicted_urls)), sorted(unmapped_confluence_pages)
Loading