Skip to content

Conversation

travishathaway
Copy link
Contributor

@travishathaway travishathaway commented Sep 10, 2024

Description

Fixes: #14072

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@travishathaway travishathaway requested a review from a team as a code owner September 10, 2024 15:19
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Sep 10, 2024
except Exception:
try:
# Remove the notices cache file if we encounter an exception
cache.clear_cache()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm still not sure this is the right approach to use. This means that every time an error is encountered, the cache files get removed and then conda checks again for these notices which is probably not the desired behavior 😭.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah good point, what kind of exceptions could we expect here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any type of error because if any error occurs at all during the command that is decorated with this decorator, we don't want the notices to be shown. At that point, there's so much output on the screen that it would be too much information presented.

Copy link

codspeed-hq bot commented Sep 10, 2024

CodSpeed Instrumentation Performance Report

Merging #14229 will not alter performance

Comparing travishathaway:bugfix-14072 (91a24cb) with main (8179ddb)

Summary

✅ 21 untouched benchmarks

cache_dir = get_notices_cache_dir()
cache_file = cache_dir.joinpath(NOTICES_CACHE_FN)

if not cache_file.is_file():
with open(cache_file, "w") as fp:
fp.write("")

current_time = time.time()
create_time = current_time - NOTICES_DECORATOR_DISPLAY_INTERVAL
os.utime(cache_file, (create_time, create_time))
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems really odd. Can we write the timestamp to a file that has true filesystem timestamps (i.e. the current time?) Recommend using mtime only as the timestamp conda cares about.

Copy link
Member

Choose a reason for hiding this comment

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

I've done this in f0d9245 (#14229)

jezdez and others added 5 commits February 28, 2025 18:20
Co-authored-by: Ken Odegard <kodegard@anaconda.com>
Co-authored-by: Daniel Holth <dholth@anaconda.com>
…ile setting modification time to past for immediate notice display
@jezdez jezdez requested review from kenodegard, jezdez and dholth June 24, 2025 16:44
@jezdez jezdez moved this from 🏗️ In Progress to 👀 In Review in 🔎 Review Jun 24, 2025
Copy link
Contributor Author

@travishathaway travishathaway left a comment

Choose a reason for hiding this comment

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

I'm feeling good about the changes that @jezdez has made since I started working on this. I think it's ready to be merged.

jaimergp
jaimergp previously approved these changes Jun 25, 2025
@github-project-automation github-project-automation bot moved this from 👀 In Review to ✅ Approved in 🔎 Review Jun 25, 2025
kenodegard
kenodegard previously approved these changes Jun 25, 2025
…ronment variable for channel notices directly
@jezdez jezdez dismissed stale reviews from kenodegard and jaimergp via 91a24cb June 25, 2025 17:29
@jezdez jezdez merged commit 989c0ab into conda:main Jun 25, 2025
75 checks passed
@github-project-automation github-project-automation bot moved this from ✅ Approved to 🏁 Done in 🔎 Review Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed [bot] added once the contributor has signed the CLA
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

conda notices doesn't display notice when package not found and considers it as seen latest
6 participants