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

Fixes #27524 - fix docker cv publishing #8259

Merged
merged 1 commit into from Aug 13, 2019

Conversation

ianballou
Copy link
Member

@ianballou ianballou commented Aug 6, 2019

To reproduce issue:

  1. Create a custom docker repo with tags (fedora/ssh perhaps)
  2. Sync it
  3. Add it to a content view
  4. Try to publish new version
  5. It will fail

To test this patch:

  1. Try the above steps
  2. Check that there are no errors
  3. Check that docker tags were indeed copied

@theforeman-bot
Copy link

Issues: #27524

@theforeman-bot
Copy link

There were the following issues with the commit message:

  • b5ffedf must be in the format fixes #redmine_number - brief description

If you don't have a ticket number, please create an issue in Redmine.

More guidelines are available in Coding Standards or on the Foreman wiki.


This message was auto-generated by Foreman's prprocessor

@theforeman-bot
Copy link

@ianballou, this pull request is currently not mergeable. Please rebase against the master branch and push again.

If you have a remote called 'upstream' that points to this repository, you can do this by running:

    $ git pull --rebase upstream master

This message was auto-generated by Foreman's prprocessor

gpg_key_id: <%= ActiveRecord::FixtureSet.identify(:fedora_gpg_key) %>
unprotected: <%= true %>
url: 'https://registry-1.docker.io'
docker_upstream_name: 'fedora/ssh'
Copy link
Member

Choose a reason for hiding this comment

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

lets not add another docker repo to fixtures. Lets try to adapt one that already exists if what we have isn't sufficient.

ensure
delete_repo(@ssh)
end

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure this test actually reproduces the problem? I think you'd have to then create some content_view repo as well, and then index, passing in the source repo. Although there'd be nothing inthe content view repo. Maybe you could copy units over to the cv repo prior

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I'll bolster this a bit

Copy link
Member Author

Choose a reason for hiding this comment

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

I've updated the test.

@ianballou ianballou force-pushed the 27524-fix-docker-cv-publish branch 2 times, most recently from d9a6175 to d69bb83 Compare August 7, 2019 19:51
@ianballou
Copy link
Member Author

Looks like I need to re record some VCRs before getting all the tests to pass.

@chris1984
Copy link
Member

Works :)

Before patch:

2019-08-08T13:56:44 [E|bac|] PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_katello_docker_tags_on_pulp_id"
13:56:44 rails.1   |  | DETAIL:  Key (pulp_id)=(5b3b0767-4e0b-4029-b7c7-da1a618aade7) already exists.
13:56:44 rails.1   |  | : insert into katello_docker_tags (repository_id, pulp_id, name,docker_taggable_id,docker_taggable_type)
13:56:44 rails.1   |  |                     select 12 as repository_id, pulp_id, name,docker_taggable_id,docker_taggable_type from katello_docker_tags
13:56:44 rails.1   |  |                     where repository_id = 11 and pulp_id not in (select pulp_id
13:56:44 rails.1   |  |                     from katello_docker_tags where repository_id = 12) (ActiveRecord::RecordNotUnique)

https://nimb.ws/RlaHdL

After patch:

https://nimb.ws/w5Jx2y

@ianballou ianballou force-pushed the 27524-fix-docker-cv-publish branch 4 times, most recently from 7ef92c7 to 9140704 Compare August 9, 2019 15:38
@ianballou
Copy link
Member Author

rebased and now I'm getting some Pulp3 Ansible errors, hm...

@sjha4
Copy link
Member

sjha4 commented Aug 9, 2019

[test katello]

assert_equal @repo.docker_tags.count, 248
service.copy_contents(@repo_copy)
@repo_copy.index_content(:source_repository => @repo)
assert_equal @repo_copy.docker_tags.count, 248
Copy link
Member

Choose a reason for hiding this comment

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

we can't rely on a specific count, as the next person that runs the test in live mode may get a different result. Something like

assert @repo.docker_tags.count > 0
assert_equal @repo.docker_tags.count, @repo_copy.docker_tags.count

should be sufficient. Also i think this test needs to be re-recorded after rebasing against master to get my vcr fixes that avoid duplicate recordings

Copy link
Member Author

Choose a reason for hiding this comment

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

Rebased and test fixed

@jlsherrill jlsherrill changed the title Fixes #27524 fix docker cv publishing Fixes #27524 - fix docker cv publishing Aug 12, 2019
Copy link
Member

@jlsherrill jlsherrill left a comment

Choose a reason for hiding this comment

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

Thanks @ianballou !!

@jlsherrill jlsherrill merged commit 5d0a6d5 into Katello:master Aug 13, 2019
@ianballou ianballou deleted the 27524-fix-docker-cv-publish branch August 13, 2019 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants