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

Added 'sort' stage to CI. #392

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

marcfehling
Copy link
Member

@marcfehling marcfehling commented Sep 8, 2022

Part of #389. Separated from #391.

@tjhei
Copy link
Member

tjhei commented Sep 9, 2022

Do you still want bibtool installed in the docker image or do we leave this as is for now?

@marcfehling
Copy link
Member Author

Do you still want bibtool installed in the docker image or do we leave this as is for now?

I still think it's handy to have in the docker image and in the CI. We can also wait and see how the new feature is received by the community. So there is no hurry right now :-)

@marcfehling
Copy link
Member Author

/rebuild

@marcfehling
Copy link
Member Author

Couldn't call make sort as it would open a shell which is not permitted.

So I tried to copy the instructions. bibtool doesn't like the jabref additions in the beginning and end of the files, so the sed commands are necessary. However, this led me to the Jenkinsfile character-escaping hell and I don't know how to get out.
https://gist.github.com/Faheetah/e11bd0315c34ed32e681616e41279ef4

@marcfehling
Copy link
Member Author

I found a solution for the sort stage.

Calling make sort from a shell didn't work. I did not understand why. I heard that it was a bug in docker that should have been solved in version 20.10. @tjhei -- Which version of docker do you run on the server?

make: /bin/sh: Operation not permitted

I tried to copy the lines from make sort into the Jenkins stage, but I went insane figuring out how to escape special characters within sed. So I went with an alternative using a regular diff that ignores the first and last lines that contain metainformation, which bibtool can not handle.

Please have a look at this solution. I will squash the commits to one once approved.

Alternatively, we could also setup a github-actions script for this.

@marcfehling
Copy link
Member Author

This is ready for review by the way. I will remove the last commit that checks the CI once approved.

@marcfehling
Copy link
Member Author

ping

@bangerth
Copy link
Member

The problem is that it requires contributors to have installed bibtool. What do we gain from requiring people to do that additional step, compared to just doing it outselves every few months?

@marcfehling
Copy link
Member Author

marcfehling commented Mar 28, 2023

The problem is that it requires contributors to have installed bibtool. What do we gain from requiring people to do that additional step, compared to just doing it outselves every few months?

For the library we do it in the same way with the indent checks, so you can apply the same arguments, too. Continous code maintenance. Detecting duplicates early. Users can check early if their entry is valid (i.e. missing commas). Keeping files readable, as entries are sorted in alphabetical order. Less conflicts in concurrent pull requests: in the past users added entries exclusively in the beginning or end of files, which required frequent rebasing.

bibtool is well-established and available in repositories for basically any UNIX operating system as documented in the readme. Users who are not comfortable with the tool can still inform us about their publications with an issue or an email as proposed in the readme. Others have done it like this in the past, see for example #358 #283 #280 #265.

The additional stage in the CI will issue a report and informs users on how they need to change their entries. So even when users can't run bibtool, they can adopt the changes from the report.

We can teach other users that management tools for bib(la)tex bibliographies like bibtool, bibcure, and biber --tool exist. @gfcas for example got to know bibtool after we introduced it with make sort in #391. He continued to apply it to his own resources, and even proposed a similar patch like this one in #467.

The price however is, and this applies also to the deal.II library itself, that such an indentation requirement adds additional steps for the user, of which installing the tool is the most tedious, but luckily it remains simple.

This check does not need to have a 'required' flag, so we can potentially still merge it when the user fails to sort their entries. This way this CI stage could simply inform us that something is wrong in the publication list. We can also introduce it as an entirely separate stage in the CI, so that a misaligned bib file does not affect subsequent stages. @tjhei -- What do you think of this approach? I can update this PR accordingly.

@bangerth
Copy link
Member

Let's see what others think -- opinions?

@marcfehling
Copy link
Member Author

Any opinions on the matter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants