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

Add additional logging to custom import task #1069

Merged

Conversation

bmclaughlin
Copy link
Contributor

@bmclaughlin bmclaughlin commented Dec 2, 2021

Adds conditional logging based on if GALAXY_ENABLE_API_ACCESS_LOG is enabled then logs collection details to the api access log in the galaxy_ng_worker_1 container where the uploads occur.

Log:

2021-12-02 18:13:54,441: INFO: Anonymous uploaded collection: newswangerd-collection_demo-1.0.11

Issue: AAH-1018

@bmclaughlin
Copy link
Contributor Author

/retest

galaxy_ng/app/tasks/publishing.py Outdated Show resolved Hide resolved
galaxy_ng/app/tasks/publishing.py Outdated Show resolved Hide resolved
galaxy_ng/app/tasks/publishing.py Outdated Show resolved Hide resolved
galaxy_ng/app/tasks/publishing.py Outdated Show resolved Hide resolved
@@ -94,3 +104,11 @@ def import_and_auto_approve(temp_file_pk, **kwargs):
log.info('Imported and auto approved collection artifact %s to repository %s',
collection_version.relative_path,
golden_repo.latest_version())

if settings.GALAXY_ENABLE_API_ACCESS_LOG:
Copy link
Contributor

Choose a reason for hiding this comment

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

are there any unit or functional tests for api logging where this msg could be added?

@bmclaughlin bmclaughlin changed the title Add additional logging to custom import task WIP: Add additional logging to custom import task Dec 3, 2021
Add namespace delete util method
Add collection delete util method
Issue: AAH-1018
Updated test_upload_collection to cleanup uploaded collection
Issue: AAH-1018
@bmclaughlin bmclaughlin force-pushed the AAH-1018-add-logging-to-publishing branch from 1948021 to 9d5fcef Compare December 10, 2021 20:49
@bmclaughlin bmclaughlin changed the title WIP: Add additional logging to custom import task Add additional logging to custom import task Dec 10, 2021
@awcrosby awcrosby self-requested a review December 10, 2021 21:05
@newswangerd newswangerd added the backport-4.4 This PR should be backported to stable-4.4 (2.1) label Dec 14, 2021
@rochacbruno rochacbruno force-pushed the AAH-1018-add-logging-to-publishing branch from 737a792 to ca4292b Compare December 14, 2021 20:23
@newswangerd newswangerd merged commit e74ea6b into ansible:master Dec 15, 2021
@patchback
Copy link

patchback bot commented Dec 15, 2021

Backport to stable-4.4: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply e74ea6b on top of patchback/backports/stable-4.4/e74ea6b1b7cb51594b3174d12554e5e4ea9717f7/pr-1069

Backporting merged PR #1069 into master

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible/galaxy_ng.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/stable-4.4/e74ea6b1b7cb51594b3174d12554e5e4ea9717f7/pr-1069 upstream/stable-4.4
  4. Now, cherry-pick PR Add additional logging to custom import task #1069 contents into that branch:
    $ git cherry-pick -x e74ea6b1b7cb51594b3174d12554e5e4ea9717f7
    If it'll yell at you with something like fatal: Commit e74ea6b1b7cb51594b3174d12554e5e4ea9717f7 is a merge but no -m option was given., add -m 1 as follows intead:
    $ git cherry-pick -m1 -x e74ea6b1b7cb51594b3174d12554e5e4ea9717f7
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR Add additional logging to custom import task #1069 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-4.4/e74ea6b1b7cb51594b3174d12554e5e4ea9717f7/pr-1069
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

newswangerd pushed a commit to newswangerd/galaxy_ng that referenced this pull request Dec 15, 2021
newswangerd pushed a commit to newswangerd/galaxy_ng that referenced this pull request Dec 15, 2021
newswangerd added a commit that referenced this pull request Dec 15, 2021
* Backport ed72e26 (#993)

* Refactoring + speeding up tests (#1002)

* Replace pulp.pulp_installer with pulp.squeezer to speed upload test

ansible-lint takes too much time on pulp.pulp_installer,
using pulp.squeezer to get a faster test

* Refactor functional tests

No-Issue

(cherry picked from commit 24f28be)

* Allow functional test configuration of URL and PASSWORD (#1026)

Issue: AAH-1015
(cherry picked from commit ab38653)

* Test Container Repository Tags endpoint (#1032)

* Add functional test for Container Repository Tags endpoint
Issue: AAH-906

(cherry picked from commit ada466b)

* Enable azure test at nightly latest workflow (#1005)

* Enable azure test at nightly latest workflow

No-Issue

(cherry picked from commit 7c6643e)

* Add functional tests for manifest lists (#1047)

* Add functional tests for AAH-964

Issue: AAH-964

* add cleanups

(cherry picked from commit 2a492fb)

* Backport e74ea6b (#1069)

* Move container test to api dir (#1035)

No-Issue

(cherry picked from commit 3bc4d42)

Co-authored-by: Fabricio Aguiar <[email protected]>
Co-authored-by: Bruno Rocha <[email protected]>
Co-authored-by: Brian McLaughlin <[email protected]>
@bmclaughlin bmclaughlin deleted the AAH-1018-add-logging-to-publishing branch December 15, 2021 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-4.4 This PR should be backported to stable-4.4 (2.1)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants