Skip to content

Fix cfgman documentation release - #37

Open
yadij wants to merge 2 commits into
mainfrom
fix-cfgman-release
Open

yadij wants to merge 2 commits into
mainfrom
fix-cfgman-release

Conversation

@yadij

@yadij yadij commented Sep 25, 2025

Copy link
Copy Markdown
Contributor

... broken since release process moved to github releases.

... broken since release process moved to github releases.
@yadij yadij added the S-waiting-for-PR Closure of other PR(s), current or future, is expected (and usually required) label Sep 25, 2025
@yadij

yadij commented Sep 25, 2025

Copy link
Copy Markdown
Contributor Author

Requires squid-cache/squid#2257 to have been merged to both v7 and v8 for this to work.

Comment thread release/mk-cfgman-docs.sh
Comment on lines +21 to +23
git checkout v$version &&
./bootstrap.sh && ./configure && make -C ./doc cfgman &&
mv -f -t $SQUID_WWW_PATH/content/Versions/$version/cfgman ./doc/cfgman/*

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT, this particular command sequence ignores failures and lets the current iteration proceed to the "update DYN documents" step that, AFAICT, depends on the failed command. If we do not want to abort the script on failures, should not we proceed to the next iteration instead?

@yadij yadij Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command sequence need to either entirely succeed, or none of the changes are usable.

It will either reach the mv which performs "publish successful changes" action. Or, it will drop out to the cleanup step following.

Logic:

  • try to build+publish
  • on success: cleanup
  • on error: cleanup + exit

Comment thread release/mk-cfgman-docs.sh
gitCleanWorkspace ()
{
git clean --quiet -xdf --exclude="\.BASE"
git checkout --quiet -- .

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A checkout command does not belong to a "clean workspace" function. The command itself looks a bit odd.

If you want to erase changes to tracked files, then use something like git reset --hard. If tracked files may remain as is, then remove this command (from this function). Let the caller checkout what they need (one caller already does, resulting in two sequential checkouts).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checkout -- . replaces any modified files with their repository committed versions. A reset only changes what a repository considers its "committed version" to be.

$ git diff configure.ac
$ echo "#FOO" >> configure.ac  && git reset -- configure.ac
Unstaged changes after reset:
M	configure.ac
$ git diff configure.ac
diff --git a/configure.ac b/configure.ac
index 8fa781e4db..2ddaba4ffa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2598,3 +2598,4 @@ AC_CONFIG_FILES([
 #AC_CONFIG_SUBDIRS(libltdl)
 
 AC_OUTPUT
+#FOO
$ git diff configure.ac
echo "#FOO" >> configure.ac  && git reset --hard -- configure.ac
fatal: Cannot do hard reset with paths.
$ git diff configure.ac
diff --git a/configure.ac b/configure.ac
index 8fa781e4db..2ddaba4ffa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2598,3 +2598,4 @@ AC_CONFIG_FILES([
 #AC_CONFIG_SUBDIRS(libltdl)
 
 AC_OUTPUT
+#FOO
$ git diff configure.ac
$ echo "#FOO" >> configure.ac  && git checkout -- configure.ac
$ git diff configure.ac

Comment thread release/mk-cfgman-docs.sh
Comment thread release/mk-cfgman-docs.sh
gitCleanWorkspace

# Update the website /Doc/config/ DYN documents
! test -d $SQUID_WWW_PATH/content/Versions/$version/cfgman && continue

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is strange to check whether this directory is present when the above commands rely on its presence to store their result. Should not this test be moved higher, where it used to reside before this PR?

@yadij yadij Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the error detection and handling you missed on the command sequence at line 21-23.
It exists here to avoid duplicating calls to the cleanup.

FYI, it looks a bit odd because the cfgman published area may also have content from a previous publication. In which case this logic is run to ensure that is still correct.

Comment thread release/mk-cfgman-docs.sh
mv -f -t $SQUID_WWW_PATH/content/Versions/$version/cfgman ./doc/cfgman/*
gitCleanWorkspace

# Update the website /Doc/config/ DYN documents

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this update use some make-generated files? If yes, we should not clean the working directory before this update (and we should not update if make fails). If not, I recommend rephrasing this comment to clarify where the new information is coming from, to remove the current implication that this information is the result of the above make.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All following logic in this script uses the result (if any) of the above mv publication command within the $SQUID_WWW_PATH area. If any above logic failed, then we likely have garbage in the checkout area that needs to be purged.

Comment thread release/mk-cfgman-docs.sh
@rousskov rousskov added the S-waiting-for-author author action is expected (and usually required) label Sep 25, 2025
squid-anubis pushed a commit that referenced this pull request Oct 5, 2025
... broken since release process moved to github releases.
@squid-anubis squid-anubis added the M-waiting-staging-checks https://github.com/measurement-factory/anubis#pull-request-labels label Oct 5, 2025
squid-anubis pushed a commit that referenced this pull request Dec 28, 2025
... broken since release process moved to github releases.
squid-anubis pushed a commit that referenced this pull request Dec 28, 2025
... broken since release process moved to github releases.
@squid-anubis squid-anubis added M-failed-staging-other https://github.com/measurement-factory/anubis#pull-request-labels and removed M-waiting-staging-checks https://github.com/measurement-factory/anubis#pull-request-labels labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

M-failed-staging-other https://github.com/measurement-factory/anubis#pull-request-labels S-waiting-for-author author action is expected (and usually required) S-waiting-for-PR Closure of other PR(s), current or future, is expected (and usually required)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants