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

fix(snapshot): ensure git author is known when committing #1405

Merged
merged 2 commits into from
Jan 12, 2024

Conversation

louis-bompart
Copy link
Collaborator

@louis-bompart louis-bompart commented Jan 5, 2024

https://coveord.atlassian.net/browse/CDX-1506

Proposed changes

Use a local git user when doing a commit for the expanded preview.

Breaking changes

Testing

  • Unit Tests:

  • Manual Tests:

    • Setup a containerized enviro with Ubuntu 22 LTS.
    • Install Node 20 LTS
    • Install the CLI with npm: npm i -g @coveo/cli
    • Run this:
    coveo org:create foobar
    mkdir testdir
    cd testdir
    coveo org:resources:pull
    coveo org:resources:push
    
    • Assert error
    • Modify ~/.nvm/versions/node/v20.10.0/lib/node_modules/@coveo/cli/lib/lib/snapshot/expandedPreviewer/expandedPreviewer.js
      or wherever is the expandedPreviewer.js file to 🐒 patch the initialPreviewCommit method:
    async initialPreviewCommit(dirPath) {
        await (0, process_1.spawnProcess)('git', ['init'], { cwd: dirPath, stdio: 'ignore' });
+       await (0, process_1.spawnProcess)('git', ['config', 'user.email', '"[email protected]"'], {cwd: dirPath, stdio: 'ignore'});
+       await (0, process_1.spawnProcess)('git', ['config', 'user.name', '"Coveo CLI"'], {cwd: dirPath, stdio: 'ignore'});
        await (0, process_1.spawnProcess)('git', ['add', '.'], { cwd: dirPath, stdio: 'ignore' });
        await (0, process_1.spawnProcess)('git', ['commit', `--message=${this.orgId} currently`], {
            cwd: dirPath,
            stdio: 'ignore',
        });
    }
  • Rerun coveo org:resources:push, assert proper execution.

@louis-bompart louis-bompart requested a review from a team as a code owner January 5, 2024 18:05
@louis-bompart louis-bompart requested review from y-lakhdar and fbeaudoincoveo and removed request for a team January 5, 2024 18:05
Copy link
Contributor

github-actions bot commented Jan 5, 2024

Thanks for your contribution @louis-bompart !
When your pull-request is ready to be merged, check the box below to merge it

  • Merge! :shipit:

Copy link
Contributor

github-actions bot commented Jan 5, 2024

Pull Request Report

PR Title

✅ Title follows the conventional commit spec.

@louis-bompart louis-bompart merged commit 1b653d8 into master Jan 12, 2024
48 checks passed
@louis-bompart louis-bompart deleted the fix/CDX-1505 branch January 12, 2024 14:41
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.

3 participants