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

Feature/colliehub version tag #281

Merged
merged 12 commits into from
Mar 13, 2024
Merged

Feature/colliehub version tag #281

merged 12 commits into from
Mar 13, 2024

Conversation

florianow
Copy link
Collaborator

@florianow florianow commented Mar 12, 2024

now its possible to pin a version for the hub in collie-cli. If no version was pinned, it takes the latest one. the collie.json is the config file for the version pinning.

@florianow florianow force-pushed the feature/colliehub-version-tag branch from e1bf8ec to 92dd064 Compare March 12, 2024 17:27
@florianow florianow force-pushed the feature/colliehub-version-tag branch from b46faa7 to 87e916a Compare March 12, 2024 17:31
@florianow florianow added this pull request to the merge queue Mar 13, 2024
Merged via the queue into main with commit 50d186a Mar 13, 2024
2 checks passed
@florianow florianow deleted the feature/colliehub-version-tag branch March 13, 2024 09:54
Copy link
Contributor

@tfelix tfelix left a comment

Choose a reason for hiding this comment

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

lgtm but only a few minor issues

@@ -118,7 +118,7 @@ export class CliApiFacadeFactory {
const detectorRunner = this.buildQuietLoggingProcessRunner();
const detector = new GitCliDetector(detectorRunner);

const processRunner = this.buildTransparentProcessRunner(detector);
const processRunner = this.buildQuietLoggingProcessRunner();
Copy link
Contributor

Choose a reason for hiding this comment

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

The whole runner setup is quite complex. But when looking close we already have a process runner with the required type. I wonder if something like


  public buildGit() {
    const detectorRunner = this.buildQuietLoggingProcessRunner();
    const detector = new GitCliDetector(detectorRunner);

    const resultHandler = new ProcessRunnerErrorResultHandler(detector);
    const quietRunner = new ResultHandlerProcessRunnerDecorator(
      new QuietProcessRunner(),
      resultHandler,
    );

    return new GitCliFacade(detectorRunner, quietRunner);
  }

works too so we need one less runner?

"--tags",
"--abbrev=0",
], { cwd: repoDir });
return result.stdout.trim();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return result.stdout.trim();
return result.stdout.trim();

s: empty line before return

"git",
"tag",
], { cwd: repoDir });
return result.stdout.trim();
Copy link
Contributor

Choose a reason for hiding this comment

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

s: empty line before return.

try {
const allTags = await this.git.getTags(hubCacheGitDir);
if (!allTags.includes(collieHubVersion)) {
throw new Error(
Copy link
Contributor

Choose a reason for hiding this comment

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

d: this is strange. you throw an error here but directly catch it 3 lines later. In this case, if you dont need to stop something through multiple call-layers I suggest to just directly stop the execution in here by directly calling Deno.exit() instead of throwing an error.

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