Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for good index (and other markdown) rendering on GitLab and Codeberg #401

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

chrysn
Copy link
Contributor

@chrysn chrysn commented Jul 19, 2023

Following up on #399 (which to my knowledge I can't indicate to GitHub in a way that it only shows the commits after "Support non-GitHub hosts for .note.xml generation") [edit: A force push of a fixed commit message after 399 was merged did resolve this], these are changes that'd make using Codeberg & co easier, but they'll probably need some rework after discussion.

As before with #399, I'd like to leave this sit for some time until I request review (while still having it available for the curious).

Prominent points I'm not too happy with are:

  1. The changed setup-readme.sh more or less copies over (and extends) the big per-host switch that is already in build-index.sh. I suppose having a script like wg-meta.sh would be the place to outsource this? [edit: Now doing something very similar to wg-meta.sh in host-meta.sh]
  2. Existing output is changed where GitHub is replaced with github.com. If 1. is properly resolved, there could be a host label that'd be used in its place. [edit: There is now a hostlabel variable generated for known hosters]

… of 'main'

The DEFAULT_BRANCH environment variable can still be used to override
it.
This change may need some revisiting, because it copies over code from
the build-index.sh.
@chrysn chrysn changed the title Changes for smooth operation on GitLab and Codeberg Changes for good index (and other markdown) rendering on GitLab and Codeberg Jul 19, 2023
@chrysn chrysn force-pushed the for-forgejo-2 branch 2 times, most recently from 8fb1cf6 to 9aa0960 Compare July 19, 2023 16:23
@chrysn
Copy link
Contributor Author

chrysn commented Jul 19, 2023

I think I've addressed my own concerns by 1. taking the pattern already established in wg-meta.sh (no need for a function call here, the variables are populated at sourcing time), and 2. applying this to get the old "GitHub" text as a hostlabel that is looked up based on the git host.

The only remaining differences a make -B -f lib/setup.mk now produces to my working repo are

  • changes to .github/workflows/ghpages.yml (which I think I'll want to refactor into standalone actions; in particular, token access for pushing to pages is set up vastly differently; then all that's left is full-URI uses lines and setting CI_HAS_WRITE_KEY=true)
  • the addition of an "or under BSD-3-clause" to license and contribution file (which is necessary for code on Codeberg), which I guess will need to be maintained manually for some time (ie. until I know what's happening first -- moving to a different Forgejo instance or more people than me using it).

@chrysn chrysn marked this pull request as ready for review July 20, 2023 09:34
@chrysn
Copy link
Contributor Author

chrysn commented Jul 20, 2023

I think that this is now similarly mature as #399 was: It should not alter the output of GitHub workflows any more.

# default-branch.py recognition only works on GitHub; on other hosters it needs
# to be set manually (also around setup.mk!), or they just use the default
# value.
DEFAULT_BRANCH := main
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
DEFAULT_BRANCH := main
DEFAULT_BRANCH ?= main

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.

None yet

2 participants