djezzzl / factory_trace

Simple tool to maintain factories and traits from FactoryBot
MIT License
381 stars 7 forks source link

Stabilize build #22

Closed chubchenko closed 2 years ago

chubchenko commented 2 years ago

Also, it will now be easier to run tests (on the local machine) for each FB version due to the usage of gemfiles instead of the constant (FB_VERSION).

BUNDLE_GEMFILE=gemfiles/fb_4_10.gemfile bundle exec rspec

No more need to run bundle update factory_bot.

djezzzl commented 2 years ago

Hi @chubchenko, thank you for your contribution!

I've just enabled the CI for forked PRs, could you please force push to trigger it?

PS, it seems that CI is failing now after I've merged your previous changes, although it may be not related. https://app.circleci.com/pipelines/github/djezzzl/factory_trace

chubchenko commented 2 years ago

Hi @chubchenko, thank you for your contribution!

I've just enabled the CI for forked PRs, could you please force push to trigger it?

PS, it seems that CI is failing now after I've merged your previous changes, although it may be not related. https://app.circleci.com/pipelines/github/djezzzl/factory_trace

@djezzzl done!

djezzzl commented 2 years ago

Thank you a lot! Such a nice improvement you did to the gem's CI 👍

djezzzl commented 2 years ago

I can only hope that you may look at:

and possibly do some contribution too 👍

djezzzl commented 2 years ago

Strange but CI on master is red: https://app.circleci.com/pipelines/github/djezzzl/factory_trace.

chubchenko commented 2 years ago

Strange but CI on master is red: https://app.circleci.com/pipelines/github/djezzzl/factory_trace.

This is strange, but I will take a look

chubchenko commented 2 years ago

do some contribution to

Yes sure, will be glad to help

djezzzl commented 2 years ago

This is strange, but I will take a look

Thank you!

chubchenko commented 2 years ago

@djezzzl could you please, try to re-run the build from failed? I see that the build for this PR was build based on my account, so I have disconnected it and guess that now it should be good.

djezzzl commented 2 years ago

Hey @chubchenko but the one which is scheduled once (per day I guess?) is also failing.

#!/bin/sh
set -e

# Workaround old docker images with incorrect $HOME
# check https://github.com/docker/docker/issues/2968 for details
if [ "${HOME}" = "/" ]
then
  export HOME=$(getent passwd $(id -un) | cut -d: -f6)
fi

echo "Using SSH Config Dir '$SSH_CONFIG_DIR'"
git --version 

mkdir -p "$SSH_CONFIG_DIR"
chmod 0700 "$SSH_CONFIG_DIR"

printf "%s" 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
' >> "$SSH_CONFIG_DIR/known_hosts"
chmod 0600 "$SSH_CONFIG_DIR/known_hosts"

rm -f "$SSH_CONFIG_DIR/id_rsa"
printf "%s" "$CHECKOUT_KEY" > "$SSH_CONFIG_DIR/id_rsa"
chmod 0600 "$SSH_CONFIG_DIR/id_rsa"
if (: "${CHECKOUT_KEY_PUBLIC?}") 2>/dev/null; then
  rm -f "$SSH_CONFIG_DIR/id_rsa.pub"
  printf "%s" "$CHECKOUT_KEY_PUBLIC" > "$SSH_CONFIG_DIR/id_rsa.pub"
fi

export GIT_SSH_COMMAND='ssh -i "$SSH_CONFIG_DIR/id_rsa" -o UserKnownHostsFile="$SSH_CONFIG_DIR/known_hosts"'

# use git+ssh instead of https
git config --global url."ssh://git@github.com".insteadOf "https://github.com" || true
git config --global gc.auto 0 || true

if [ -e '/home/circleci/factory_trace/.git' ] ; then
  echo 'Fetching into existing repository'
  existing_repo='true'
  cd '/home/circleci/factory_trace'
  git remote set-url origin "$CIRCLE_REPOSITORY_URL" || true
else
  echo 'Cloning git repository'
  existing_repo='false'
  mkdir -p '/home/circleci/factory_trace'
  cd '/home/circleci/factory_trace'
  git clone --no-checkout "$CIRCLE_REPOSITORY_URL" .
fi

if [ "$existing_repo" = 'true' ] || [ 'false' = 'true' ]; then
  echo 'Fetching from remote repository'
  if [ -n "$CIRCLE_TAG" ]; then
    git fetch --force --tags origin
  else
    git fetch --force origin '+refs/heads/master:refs/remotes/origin/master'
  fi
fi

if [ -n "$CIRCLE_TAG" ]; then
  echo 'Checking out tag'
  git checkout --force "$CIRCLE_TAG"
  git reset --hard "$CIRCLE_SHA1"
else
  echo 'Checking out branch'
  git checkout --force -B "$CIRCLE_BRANCH" "$CIRCLE_SHA1"
  git --no-pager log --no-color -n 1 --format='HEAD is now at %h %s'
fi

Using SSH Config Dir '/home/circleci/.ssh'
git version 2.30.2
Cloning git repository
Cloning into '.'...
Warning: Permanently added the RSA host key for IP address '140.82.113.3' to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

exit status 128

CircleCI received exit code 128

from https://app.circleci.com/pipelines/github/djezzzl/factory_trace/41/workflows/4d168d75-0c71-4964-aa17-87bf2575411f/jobs/186

chubchenko commented 2 years ago

@djezzzl Hi 👋 I have spent some time taking a look at the checkout issue. So it looks like there is a misconfiguration between GitHub and CircleCI. I have found 2 same issues on the CircleCI discuss:

Could you try to re-connect CircleCI for this repository?

Here is the guide on how to disconnect it.

Let me know if it will help.

djezzzl commented 2 years ago

Hi @chubchenko,

The thing is that I don't see neither of webhooks nor deploy keys configured. But thank you for your findings, I'll try to reset Circle CI on the repository.

djezzzl commented 2 years ago

Seems like it fixed the issue, thank you very much!

https://app.circleci.com/pipelines/github/djezzzl/factory_trace/43/workflows/8c20080e-d295-4d1e-900c-1307afe173fe