Skip to content

Build script rework#1328

Merged
bill-long merged 3 commits into
mainfrom
bilong-build
Nov 10, 2022
Merged

Build script rework#1328
bill-long merged 3 commits into
mainfrom
bilong-build

Conversation

@bill-long
Copy link
Copy Markdown
Member

@bill-long bill-long commented Nov 8, 2022

Issue 1:
It's easy to accidentally release a new script. This can happen if a script that was previously included in another script is no longer included, or if a new script is added for testing or some other reason.

Fix 1:
This new build logic only publishes a script if one of the following is true:

  • \docs contains a *.md file matching the script name.
  • \docs contains a folder with an index.md file in it, where the folder name matches the script name.

Issue 2:
Build.ps1 performs repetitive disk-intensive work, which takes longer than necessary.

Fix 2:
The new logic scans the repo, building a hashtable of dependencies and commit times. These hashtables are then used within Build.ps1 itself, so that we don't have to go back to disk for the same information repeatedly.

Issue 3:
Build.ps1 is very quiet and doesn't give much information about what it's up to.

Fix 3:
The new logic produces a ton of output, including full dependency trees for each script, and the commit time on each of those files. It also calls out unreferenced scripts in the global Shared folder as well as scripts that are both undocumented and unreferenced in other folders.

Issue 4:
It is possible to merge a PR to main which has older timestamps than what is already in main. This causes a new script to release without a version number change, even though the script changed.

Fix 4:
Switch from author time to commit time for version numbers. Then, use the new ValidateMerge.ps1 in the pipeline for PRs to main. If it discovers commit times in the PR that are older than what is already in main, it will instruct the user to rebase, which will update the commit times in the PR. Fixes #1330.

@bill-long bill-long force-pushed the bilong-build branch 4 times, most recently from dff2edf to ec48cb1 Compare November 10, 2022 03:03
@bill-long bill-long changed the title Only publish scripts that have docs Build script rework Nov 10, 2022
@bill-long bill-long force-pushed the bilong-build branch 3 times, most recently from f20ffa5 to 743719b Compare November 10, 2022 04:20
@bill-long bill-long marked this pull request as ready for review November 10, 2022 04:21
@bill-long bill-long requested a review from a team as a code owner November 10, 2022 04:21
@bill-long bill-long force-pushed the bilong-build branch 9 times, most recently from 5e128d5 to 90f641b Compare November 10, 2022 15:44
- Change from author date to commit date for version numbers
- Optimize build speed by caching dependencies and timestamps
- Output a lot more info about what Build.ps1 is doing
- Only release scripts that have docs
- Add docs for scripts missing docs
- Validate that PRs do not have commits that are older than main
@bill-long bill-long merged commit 1acb541 into main Nov 10, 2022
@bill-long bill-long deleted the bilong-build branch November 10, 2022 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Work Item] Build Number Logic Failure

2 participants