Skip to content

Commit c55eebf

Browse files
chore: Updates after 3.1.0 release (#4183)
* Incorporated ShadowPackage changes * package and changelog update * corrected ngo-publish job * corrected re.search * added validation exceptions from false-positive failure * updated ValidationExceptions * Updated ValidationExceptions place * removal of ValidationExceptiosn for pack job * added ifdef
1 parent 4a1d5dc commit c55eebf

11 files changed

Lines changed: 87 additions & 22 deletions

File tree

‎.yamato/ngo-publish.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ngo_release_preparation:
33
agent: { type: Unity::VM, flavor: b1.small, image: package-ci/ubuntu-22.04:v4 }
44
triggers:
55
recurring:
6-
- branch: develop-2.0.0 # We make new releases from this branch
6+
- branch: develop-3.x.x # We make new releases from this branch
77
frequency: "10 ? * 1" # Runs every Sunday at 10:00 AM
88
commands:
99
- pip install PyGithub

‎.yamato/package-pack.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ package_pack_-_ngo_{{ platform.name }}:
4242
variables:
4343
XRAY_PROFILE: "gold ./pvpExceptions.json rme"
4444
commands:
45+
# Remove ValidationExceptions.json and its .meta file if they exist. For this specific test it's necessary (otherwise we want to keep them since we use those for release).
46+
{% if platform.name == "win" %}
47+
- if exist com.unity.netcode.gameobjects\ValidationExceptions.json del /f /q com.unity.netcode.gameobjects\ValidationExceptions.json
48+
- if exist com.unity.netcode.gameobjects\ValidationExceptions.json.meta del /f /q com.unity.netcode.gameobjects\ValidationExceptions.json.meta
49+
{% else %}
50+
- rm -f com.unity.netcode.gameobjects/ValidationExceptions.json
51+
- rm -f com.unity.netcode.gameobjects/ValidationExceptions.json.meta
52+
{% endif %}
53+
4554
- upm-pvp pack "com.unity.netcode.gameobjects" --output upm-ci~/packages
4655
- upm-pvp xray --packages "upm-ci~/packages/com.unity.netcode.gameobjects*.tgz" --results pvp-results
4756
- upm-pvp require {% if platform.name == "win" %}"%XRAY_PROFILE%"{% else %}"$XRAY_PROFILE"{% endif %} --results pvp-results --allow-missing

‎Tools/scripts/ReleaseAutomation/release_config.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ class ReleaseConfig:
5050
def __init__(self):
5151
self.manifest_path = 'com.unity.netcode.gameobjects/package.json'
5252
self.changelog_path = 'com.unity.netcode.gameobjects/CHANGELOG.md'
53-
self.validation_exceptions_path = './ValidationExceptions.json'
53+
self.validation_exceptions_path = 'com.unity.netcode.gameobjects/ValidationExceptions.json'
5454
self.github_repo = 'Unity-Technologies/com.unity.netcode.gameobjects'
55-
self.default_repo_branch = 'develop-2.0.0' # Changelog and package version change will be pushed to this branch
55+
self.default_repo_branch = 'develop-3.x.x' # Changelog and package version change will be pushed to this branch
5656
self.yamato_project_id = '1201'
5757
self.command_to_run_on_release_branch = make_package_release_ready
5858

‎Tools/scripts/Utils/general_utils.py‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,20 @@ def update_changelog(changelog_path, new_version, add_unreleased_template=False)
132132
with open(changelog_path, 'r', encoding='UTF-8') as f:
133133
changelog_text = f.read()
134134

135-
# This pattern finds a line starting with '###', followed by its newline,
136-
# and then two more lines that contain only whitespace.
135+
# This pattern finds a line starting with '###' followed only by blank lines up to the next heading or end of section.
137136
# The re.MULTILINE flag allows '^' to match the start of each line.
138-
pattern = re.compile(r"^###.*\n\n\n", re.MULTILINE)
139-
140-
# Replace every match with an empty string. The goal is to remove empty CHANGELOG subsections.
141-
cleaned_content = pattern.sub('', changelog_text)
137+
pattern = re.compile(r"^###[^\n]*\n(?:[ \t]*\n)*(?=##|\Z)", re.MULTILINE)
138+
139+
# Replace every match within the [Unreleased] section with an empty string. The goal is to remove empty CHANGELOG subsections.
140+
# Released sections are left untouched since some of them use '###' for their version heading.
141+
cleaned_content = changelog_text
142+
unreleased_section = re.search(r'(?ms)^## \[Unreleased\].*?(?=^## \[|\Z)', changelog_text)
143+
if unreleased_section:
144+
cleaned_content = (
145+
changelog_text[:unreleased_section.start()] +
146+
pattern.sub('', unreleased_section.group(0)) +
147+
changelog_text[unreleased_section.end():]
148+
)
142149

143150
if version_header_to_find_if_exists in changelog_text:
144151
warnings.warn(f"A changelog entry for version '{new_version}' already exists. The script will just remove Unreleased section and its content.")

‎Tools/scripts/release.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def make_package_release_ready(manifest_path, changelog_path, validation_excepti
8888
if __name__ == '__main__':
8989
manifest_path = 'com.unity.netcode.gameobjects/package.json'
9090
changelog_path = 'com.unity.netcode.gameobjects/CHANGELOG.md'
91-
validation_exceptions_path = './ValidationExceptions.json'
91+
validation_exceptions_path = 'com.unity.netcode.gameobjects/ValidationExceptions.json'
9292
package_version = get_package_version_from_manifest(manifest_path)
9393

9494
make_package_release_ready(manifest_path, changelog_path, validation_exceptions_path, package_version)

‎ValidationExceptions.json‎

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

‎com.unity.netcode.gameobjects/CHANGELOG.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ Additional documentation and release notes are available at [Multiplayer Documen
1212

1313
### Changed
1414

15-
- Updated Netcode for Entities dependency to 7.1.0
16-
1715
### Deprecated
1816

1917
### Removed
@@ -24,6 +22,12 @@ Additional documentation and release notes are available at [Multiplayer Documen
2422

2523
### Obsolete
2624

25+
## [3.1.0] - 2026-10-04
26+
27+
### Changed
28+
29+
- Updated Netcode for Entities dependency to 7.1.0
30+
2731
## [3.0.0] - 2026-09-14
2832

2933
### Added

‎com.unity.netcode.gameobjects/Editor/InScenePlacedProcessor.cs‎

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,47 @@
55
using UnityEngine;
66
using UnityEngine.SceneManagement;
77

8+
#if UNITY_7000_0_OR_NEWER
9+
using UnityEditor.Build.Content;
10+
#endif
11+
812
namespace Unity.Netcode.GameObjects.Editor
913
{
1014
/// <summary>
11-
/// A <see cref="IProcessSceneWithReport"/> that sets the <see cref
15+
/// A build scene callback that sets the <see cref
1216
/// "NetworkObject.InScenePlaced"/> property to true for all <see cref="NetworkObject"/>s in the scene.
1317
/// Ensures that InScenePlaced is always true for all objects in the scene.
1418
/// </summary>
1519
/// <remarks>
16-
/// This will always run as the game enters the scene,
20+
/// This will always run as a scene is loaded in playmode or while processed for a player build.
1721
/// </remarks>
22+
#if UNITY_7000_0_OR_NEWER
23+
internal class SetInScenePlaced : AssetPostprocessor
24+
{
25+
public override uint GetVersion() => 1;
26+
27+
public override int GetPostprocessOrder() => 0;
28+
29+
void OnProcessScene(Scene scene, SceneImportContext sceneImportContext)
30+
{
31+
InScenePlaceChecks.ReportSceneIssues(scene, sceneImportContext.awakeDidRun);
32+
}
33+
}
34+
#else
1835
internal class SetInScenePlaced : IProcessSceneWithReport
1936
{
2037
public int callbackOrder => 0;
38+
2139
public void OnProcessScene(Scene scene, BuildReport report)
40+
{
41+
InScenePlaceChecks.ReportSceneIssues(scene, Application.isPlaying);
42+
}
43+
}
44+
#endif
45+
46+
internal static class InScenePlaceChecks
47+
{
48+
public static void ReportSceneIssues(Scene scene, bool hasAwakeRun)
2249
{
2350
var log = new ContextualLogger();
2451
log.AddInfo(scene.name, scene.handle);
@@ -42,15 +69,15 @@ public void OnProcessScene(Scene scene, BuildReport report)
4269
continue;
4370
}
4471

45-
// If already marked, the do nothing.
72+
// If already marked, do nothing.
4673
if (networkObject.InScenePlaced)
4774
{
4875
continue;
4976
}
5077

5178
networkObject.InScenePlaced = true;
52-
// Will not be true when making a build and the values are serialized.
53-
networkObject.InScenePlacedPostProcessorMarkedDuringRuntime = Application.isPlaying;
79+
// Mark that awake has run so this could have been a dynamically instantiated object.
80+
networkObject.InScenePlacedPostProcessorMarkedDuringRuntime = hasAwakeRun;
5481
}
5582
}
5683
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"ErrorExceptions": [
3+
{
4+
"ValidationTest": "NDA Keyword Validation",
5+
"ExceptionMessage": "#if UNITY_7000_0_OR_NEWER",
6+
"PackageVersion": "3.1.1"
7+
},
8+
{
9+
"ValidationTest": "NDA Keyword Validation",
10+
"ExceptionMessage": "File 'Editor/InScenePlacedProcessor.cs' contains deny-listed keyword pattern '(?<!BestPracticeUnderstandingPerformanceIn)unity[ _]*7' It must not be published",
11+
"PackageVersion": "3.1.1"
12+
}
13+
],
14+
"WarningExceptions": []
15+
}

‎com.unity.netcode.gameobjects/ValidationExceptions.json.meta‎

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)