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

Dockerize for GitHub execution #4

Merged
merged 9 commits into from
Oct 29, 2023

Conversation

jprosenbaum
Copy link
Contributor

No description provided.

@Emm
Copy link
Owner

Emm commented Sep 15, 2023

Hi! Sorry about being a bad maintainer and not being responsive, I never saw that PR. I think dockerizing the tool is a good idea, so I'll be happy to work with you on getting this merged.

You may want to start with rebasing your PR, I have just updated the dependencies.

@@ -67,7 +67,7 @@ pub fn parse_commits(
) -> Result<Commits> {
lazy_static! {
static ref SHORTCUT_RE: Regex =
Regex::new(r"^\[(?:sc-|ch)(\d+)\]").expect("Could not compile SHORTCUT_RE");
Regex::new(r"(?:\[sc-|\[ch|story/)(\d+)").expect("Could not compile SHORTCUT_RE");
Copy link
Owner

Choose a reason for hiding this comment

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

Is story a prefix supported by Shortcut for linking commits to issues automatically? The documentation does not suggest it...

If it's not the case, this would be better as a separate PR.

If the idea is to support user-defined prefixes, why not. But this means making it configurable in config.toml (an optional array would be ideal). We would also need either to restrict the prefixes to something like [a-zA-Z]+ (or be ready to escape characters.

One last point, your commit would also find a comment like Unlike what we did for [sc-XXX], this is actually a good idea. If the purpose is to find badly formatted commits like [sc-XXX] I suggest to simply trim the string/allow ^\s* at the start.

Copy link
Contributor Author

@jprosenbaum jprosenbaum Sep 18, 2023

Choose a reason for hiding this comment

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

I added story to the regex to cover missed associations but a story URL was in the PR history
Story details: https://app.shortcut.com/xyz/story/####

This was happening when a PR title did not reference the story ID, but a commit or the branch name linked to the story. Shortcut was pushing story link annotation onto the PR.

This change would detect those instances and make sure they were associated correctly.

The removal of ^ was to account for the URL case.
It also captured when the story id was not at the start of the commit message.

Copy link
Owner

Choose a reason for hiding this comment

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

All right, thanks. I'll have a look this week.

Copy link
Owner

Choose a reason for hiding this comment

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

All right, thanks. I'll have a look this week.

More like next week I'm afraid :(

shortcut_release_helper/Cargo.toml Outdated Show resolved Hide resolved
shortcut_release_helper/src/main.rs Show resolved Hide resolved
@jprosenbaum
Copy link
Contributor Author

@Emm I have rebased the branch.

Copy link
Owner

Choose a reason for hiding this comment

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

I have started testing it, unfortunately the OpenAPI generator blows up with a stack overflow error. We may need to pin that to a specific version if possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you post the error. I can look at it in a few days

@Emm
Copy link
Owner

Emm commented Oct 20, 2023

@jprosenbaum , I finally got around to working on this. Can you check out the dockerize-for-github-execution branch when you get the opportunity? The Dockerfile is based on your version, but somewhat shorter. The commits on the branch should make reasonably easy to follow what changed, but basically:

  • no more dos2unix, we now use .gitattributes (which is also in master) to preserve Unix line endings for bash scripts
  • no more RUN chmod, it is done by passing an option to COPY
  • we download a specific release of the OpenAPI generator from Github
  • we copy the lock file (we also the cached layer, but I think it's a good tradeoff)

This is simpler and lets us control which version we get.
Loses the cache though.
@Emm Emm force-pushed the dockerize-for-github-execution branch from 64f063a to 0b7fc33 Compare October 21, 2023 07:40
@Emm Emm merged commit 05e9ddb into Emm:master Oct 29, 2023
1 check passed
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.

2 participants