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

docs: generate citations meta data #4205

Merged
merged 7 commits into from
Sep 22, 2023
Merged

docs: generate citations meta data #4205

merged 7 commits into from
Sep 22, 2023

Conversation

toidiu
Copy link
Contributor

@toidiu toidiu commented Sep 18, 2023

Description of changes:

NOTE: In this PR I only made changes to .github/workflows/ci_compliance.yml to check for uncommitted changes. All other changes were auto generated by running the initialize_duvet.sh script.

After this PR, we now generating the duvet report. However, it lacks links for the TLS1.2 RFC (5246).

We need to duvet extract and commit the the meta-data inorder for the links to work (tested locally). I cleaned up the specs folder and re-ran the initialize_duvet.sh script to regenerate this meta-data so you will notice other rfc links also changed in minor ways.

Callout

  • It seems like the section keyword got added in the rfc website which resulted in a larger change to all the meta-data. However, if we continue to re-run the initialize_duvet.sh script we should remain consistent.

Testing

I tested changes to the github action on my personal fork: https://github.com/toidiu/s2n-tls/commits/main

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the s2n-core team label Sep 18, 2023
@toidiu toidiu force-pushed the ak-genCitations branch 2 times, most recently from c77f244 to be8080f Compare September 18, 2023 18:08
@toidiu toidiu marked this pull request as ready for review September 18, 2023 18:08
@toidiu toidiu requested a review from goatgoose September 18, 2023 21:30
compliance/initialize_duvet.sh Outdated Show resolved Hide resolved
@lrstewart
Copy link
Contributor

Why all the renames?

@camshaft
Copy link
Contributor

Why all the renames?

This was a change in how duvet linked to sections, in order for them to actually resolve once you followed them.

@lrstewart
Copy link
Contributor

Why all the renames?

This was a change in how duvet linked to sections, in order for them to actually resolve once you followed them.

If this depends on duvet's implementation, should we be committing these specs? Or should they be generated when needed?

@toidiu
Copy link
Contributor Author

toidiu commented Sep 20, 2023

If this depends on duvet's implementation, should we be committing these specs? Or should they be generated when needed?

We dont make alot of changes to duvet so it feels ok to commit. However we could try auto generating them in the CI.. and that would save us a step when adding new specs.

@camshaft
Copy link
Contributor

If this depends on duvet's implementation, should we be committing these specs? Or should they be generated when needed?

I think it's useful to commit the specs, especially for CI where the fetch from tools.ietf.org might fail.

@lrstewart
Copy link
Contributor

I think it's useful to commit the specs, especially for CI where the fetch from tools.ietf.org might fail.

I can definitely see either way, but it looks like we haven't been remembering to commit them and there isn't currently a mechanism to remind us. What's to ensure we commit them going forwards? I'm not super worried about the fetch failing-- we can always add a retry for that step in whatever ci job we write.

@camshaft
Copy link
Contributor

What's to ensure we commit them going forwards?

I think this is the more appropriate path forward, TBH. It should be possible to run the extract script and run git diff to see if anything new was added.

toolchain: stable
override: true

- uses: camshaft/rust-cache@v1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is also a cache operation in the duvet action and I am not sure if the caching will mess with consecutive runs. From my own testing it didnt seem to interact. @camshaft

Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to duplicate all of these steps from the workflow? Why not just run the check after it runs?

Copy link
Contributor Author

@toidiu toidiu Sep 20, 2023

Choose a reason for hiding this comment

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

I wanted to avoid the upload to s3 (part of the duvet action) if the checks fails. But we do install duvet twice and the duplication is not ideal. I like your suggestion 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

4352fc4

The duvet report command generates some artifacts (specs folder) that interfere with detecting uncommitted files. Instead I introduce a step to cleanup those files. Since the cleanup runs prior to the “Extract RFC spec data” phase I think it relatively safe

@toidiu toidiu requested a review from camshaft September 20, 2023 22:07
.github/workflows/ci_compliance.yml Outdated Show resolved Hide resolved
Comment on lines +50 to +53
# If this fails you need to run `cd compliance && ./compliance/initialize_duvet.sh`
#
Copy link
Contributor

Choose a reason for hiding this comment

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

If the fix is to run "initialize_duvet.sh", and this diff is produced by running "initialize_duvet.sh", why are we requiring developers to do this manually? If we need to run "initialize_duvet.sh" anyway why not just use the result?

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like Duvet doesn't do anything if the spec folder already exists: https://github.com/awslabs/duvet/blob/5ed1e4edf75026f83a9fc678a382aa32d16faff7/src/target.rs#L79 So this DOES still save us network calls and make this action less likely to fail.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please put a comment on this so that it's clear why we're doing this, and future developers don't ask the same question :) Without context, this looks very silly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sadly our duvet reporting is a bit messy at the moment and I found 2 issues with it. This does mean we are downloading the RFC specs in our CI at the moment. I am going to leave a comment linking these issue since ideally we do not re-download the RFC spec each time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Documented the issue in code as well:
e988e26

.github/workflows/ci_compliance.yml Show resolved Hide resolved
@toidiu toidiu requested a review from lrstewart September 21, 2023 23:47
@toidiu toidiu enabled auto-merge (squash) September 22, 2023 16:53
@toidiu toidiu merged commit 7318609 into aws:main Sep 22, 2023
@toidiu toidiu deleted the ak-genCitations branch September 22, 2023 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants