Skip to content

Commit 7339c0f

Browse files
authored
Merge pull request #573 from mitre-attack/update-release-docs
chore: update release documentation
2 parents c16be28 + f01b255 commit 7339c0f

7 files changed

Lines changed: 33 additions & 111 deletions

File tree

.towncrier.template.md

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

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ Run commands from the repo root unless a subdirectory is called out.
188188

189189
- Pull requests should target the `develop` branch per `CONTRIBUTING.md`.
190190
- The PR template expects a reviewer and a `CHANGELOG.md` update when appropriate.
191-
- `pyproject.toml` configures Towncrier for `CHANGELOG.md`; prefer the repository's release-note fragment workflow when one is present instead of hand-editing generated changelog sections.
191+
- The website version is configured in `modules/site_config.py`; keep it aligned with release tags and docs.
192192
- Do not assume `master` is the integration branch just because GitHub Pages deploys from it.
193193
- Use Conventional Commit style git messages.
194194

docs/RELEASE.md

Lines changed: 29 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ If you are only updating the banner and nothing else, follow these steps.
1616

1717
1. Verify that all features/bugs/documentation updates are tied to issues from the [issue tracker](https://github.com/mitre-attack/attack-website/issues).
1818

19-
* Make sure that each issue that is addressed has a corresponding `<issue-#>.[feature | bugfix | doc | misc]` in the `newsfragments/` directory.
19+
* Update and commit any necessary changes to `CHANGELOG.md`
2020

2121
2. Merge the `master` branch into the `develop` branch, since commits to `master` may have been made for banner updates.
2222

@@ -27,7 +27,7 @@ If you are only updating the banner and nothing else, follow these steps.
2727

2828
3. Verify that all required changes for the next release are present in the `develop` branch, including merging finished feature/bugfix branches.
2929

30-
* Update the website version number in `pyproject.toml`
30+
* Update the website version number in `modules/site_config.py`
3131
* Update any dependencies needed in `requirements.txt`.
3232
* If applicable, update the year in the following files:
3333
* `attack-theme/templates/general/base-template.html`
@@ -36,44 +36,21 @@ If you are only updating the banner and nothing else, follow these steps.
3636
* `LICENSE.txt`
3737
* `README.md`
3838

39-
4. Use `towncrier` to update the `CHANGELOG`
39+
4. If this website build includes ATT&CK/STIX content updates, see the appropriate section below for either Major or Minor ATT&CK releases
4040

41-
* Run `towncrier --draft`.
42-
* If everything looks good, then proceed with running `towncrier`.
43-
* This will delete the newsfragment files.
44-
* Doublecheck the `CHANGELOG.md` file since the template isn't perfect and whitespace issues get introduced.
45-
* Here is an example of `towncrier` output.
46-
Notice that it adds a bunch of hyphens under the main header and adds a trailing newline.
47-
These lines can be removed to ensure consistency with the rest of the CHANGELOG.md file.
48-
49-
```text
50-
# v4.0.0 (2022-10-25)
51-
--------------------- <--- DELETE THIS LINE
52-
## Features
53-
54-
* Add support for [Campaigns](https://github.com/mitre/cti/blob/master/USAGE.md#campaigns) [#384]
55-
(https://github.com/mitre-attack/attack-website/issues/384)
56-
<newline>
57-
<newline> <-- DELETE THIS LINE
58-
```
59-
60-
* Run `git status`, then stage and commit changes to `CHANGELOG.md` and removed files from `newsfragments/`.
61-
62-
5. If this website build includes ATT&CK/STIX content updates, see the appropriate section below for either Major or Minor ATT&CK releases
63-
64-
6. Build the website locally to do one final test that it looks correct
41+
5. Build the website locally to do one final test that it looks correct
6542

6643
* e.g. `python update-attack.py --attack-brand --extras --no-test-exitstatus`
6744
* Look in the generated `reports/broken-links-report.txt` for broken links.
6845
Any broken links that start with `/versions/v*` can be ignored.
6946

70-
7. Commit and push changes to the `develop` branch.
47+
6. Commit and push changes to the `develop` branch.
7148

72-
8. Open a pull request from `develop` to `master` <https://github.com/mitre-attack/attack-website/pulls>.
49+
7. Open a pull request from `develop` to `master` <https://github.com/mitre-attack/attack-website/pulls>.
7350

7451
* PR naming convention: "Update website to X.Y.Z"
7552

76-
9. After the PR is accepted, tag the commit in the master branch and push the changes
53+
8. After the PR is accepted, tag the commit in the master branch and push the changes
7754

7855
```bash
7956
git checkout master
@@ -85,36 +62,30 @@ If you are only updating the banner and nothing else, follow these steps.
8562

8663
## ATT&CK Content updates
8764

88-
Consult these sections as needed for step 5 in the above list.
65+
Consult these sections as needed for step 4 in the above list.
8966

9067
* Create a detailed changelog for the release:
9168
* Create a new folder: `modules/resources/docs/changelogs/v<previous-ATT&CK-version>-v<current-ATT&CK-version>`
92-
* Create a detailed changelog using mitreattack-python
69+
* Create a detailed changelog and excel files using mitreattack-python
9370

9471
```sh
95-
# Clone mitreattack-python repo and download latest ATT&CK STIX
96-
git clone git@github.com:mitre-attack/mitreattack-python.git
97-
cd mitreattack-python
98-
python3 -m venv venv
99-
. venv/bin/activate
100-
pip install -r requirements-dev.txt
101-
pip install -e .
102-
cd examples/
103-
download_attack_stix --all
104-
105-
# update the generate_multiple_attack_diffs.py file to have the correct comparison pairs
106-
# run the script
107-
python generate_multiple_attack_diffs.py
108-
72+
ATTACK_WEBSITE_REPO="/path/to/attack-website/repo"
73+
ATTACK_PREVIOUS_VERSION=18.1
74+
ATTACK_CURRENT_VERSION=19.0
75+
76+
# generate detailed changelog
77+
uvx --from mitreattack-python attack-changelog \
78+
--attack-website-links \
79+
--old-version ${ATTACK_PREVIOUS_VERSION} \
80+
--new-version ${ATTACK_CURRENT_VERSION} \
81+
--output-dir ${ATTACK_WEBSITE_REPO}/modules/resources/docs/changelogs/v${ATTACK_PREVIOUS_VERSION}-v${ATTACK_CURRENT_VERSION}
82+
83+
# generate excel files
84+
uvx --from mitreattack-python attack-to-excel from-release \
85+
--version ${ATTACK_CURRENT_VERSION} \
86+
--output=${ATTACK_WEBSITE_REPO}/modules/resources/docs/attack-excel-files
10987
```
11088

111-
* Manually modify the detailed changelog's href's at the top for links to the Navigator layers and changelog.json
112-
* TODO: one day modify the script above to not need this edit anymore
113-
* Put the following files from the `diff_stix` command into the folder created above
114-
* `changelog-detailed.html`
115-
* `changelog.json`
116-
* Any ATT&CK Navigator layer files that were generated
117-
11889
### Major release
11990

12091
* Update `data/versions.json`
@@ -124,12 +95,15 @@ Consult these sections as needed for step 5 in the above list.
12495
* `cti_url`: should be tag URL for the release on the mitre/cti repo
12596
* `commit`: should be sha256 hash of latest commit from mitre-attack/attack-website on the `gh-pages` branch prior to new content release
12697

127-
* Run the `archive-website.py` script to get the previously released archives of the ATT&CK website
98+
* (If not already completed for this release) Run the `archive-website.py` script to get the previously released archives of the ATT&CK website
12899
* Upload the `tar.gz` of the latest previous version of the website to the [Archived Website Files](https://github.com/mitre-attack/attack-website/releases/tag/archived-website-files) release
129100
* Optional - If sufficient changes were made to the archive process then re-upload all `tar.gz` files
130101
* Update notes
131102
* Add new file: `modules/resources/static_pages/updates-<month>-<year>.md`
132103
* Update former updates announcement file to specify end date of old release
104+
* Create the release-summary table for the new updates page
105+
* This is the markdown table at the top of the release announcement that lists the ATT&CK version, start/end dates, MITRE/CTI release links, and changelog links
106+
* TODO - write a script to create the html table data for new releases
133107
* Update CHANGELOG.md
134108
* Add a bullet point to the Features section in the following format
135109

@@ -150,6 +124,7 @@ Check the layer specification version [here](https://github.com/mitre-attack/att
150124
* Minor releases currently don't get their own update page, so make the following updates to the table at the top of the page:
151125
* Under the Data column: Add a new entry for the latest tag, using `<br />` to separate them
152126
* Under the Changelogs column: Add a new entry for the latest detailed changelog, for both HTML and JSON (also using `<br />` as a separator)
127+
* TODO - write a script to update the html table data for new releases
153128
* Update CHANGELOG.md
154129
* Add a bullet point to the Features section in the following format
155130

modules/site_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
load_dotenv()
1010

1111
attack_version = ""
12+
website_version = "4.4.2"
1213

1314
# Read versions file for ATT&CK version
1415
with open("data/versions.json", "r", encoding="utf8") as f:

modules/website_build/website_build_config.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import os
22
from string import Template
33

4-
import toml
5-
64
import modules
75
from modules import site_config
86

@@ -12,9 +10,6 @@
1210
# Template directory
1311
template_dir = os.path.join("attack-theme", "templates", "general/")
1412

15-
pyproject_toml = toml.load("pyproject.toml")
16-
website_version = pyproject_toml["tool"]["towncrier"]["version"]
17-
1813
# Base page data for website header and footer
1914
# additional keys that are used/set in website_build.py:
2015
# BANNER_ENABLED
@@ -23,7 +18,7 @@
2318
# RESOURCES
2419
base_page_data = {
2520
"CONTENT_VERSION": site_config.attack_version,
26-
"WEBSITE_VERSION": website_version,
21+
"WEBSITE_VERSION": site_config.website_version,
2722
"CHANGELOG_LOCATION": "/resources/changelog.html",
2823
"LOGO_HEADER": "/theme/images/mitre_attack_logo.png",
2924
"LOGO_FOOTER": "/theme/images/mitrelogowhiteontrans.gif",

pyproject.toml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@ line-length = 120
44
[tool.isort]
55
profile = "black"
66

7-
[tool.towncrier]
8-
name = "ATT&CK website"
9-
version = "4.4.2"
10-
filename = "CHANGELOG.md"
11-
issue_format = "[#{issue}](https://github.com/mitre-attack/attack-website/issues/{issue})"
12-
template = ".towncrier.template.md"
13-
start_string = "<!-- TOWNCRIER -->\n"
14-
title_format = "# v{version} ({project_date})"
15-
underlines = ["-", "", ""]
16-
177
[tool.ruff]
188
line-length = 120
199
ignore = [

requirements.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ bleach==6.3.0
44
colorama==0.4.6
55
future==1.0.0
66
loguru==0.7.3
7-
mitreattack-python==5.5.0
7+
mitreattack-python==6.0.1
88
pelican==4.12.0
99
pelican-sitemap==1.2.2
1010
python-dotenv==1.2.2
1111
requests==2.33.1
1212
stix2==3.0.2
1313
stix2-validator==3.2.0
14-
toml==0.10.2
15-
towncrier==25.8.0
1614

1715
# dev dependencies
1816
ruff>=0.15.11

0 commit comments

Comments
 (0)