-
Notifications
You must be signed in to change notification settings - Fork 75
feat(activity-updater): Add activity updater to automatically fetch activity info. #388
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
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…nsformed all time into epoch time.
Currently only tested in Global server
BREAKING CHANGE: Version 3 completely removed atx-agent, see https://github.com/openatx/uiautomator2/blob/master/docs/2to3.md
uiautomator2==3.4.0 depends on adbutils>=2.9.3,<2.10.0, so it requires a dependency version bump
# Conflicts: # core/Baas_thread.py # core/image.py # main.py # module/ExploreTasks/TaskUtils.py # module/ExploreTasks/explore_task.py # module/__init__.py
…pr-activity-refactor) Moved all individual activity definition files into a new `activitiy_data` subpackage. This improves module organization by separating activity data from core logic, making the `module/activities` directory cleaner.
Adds a `if __name__ == "__main__":` guard, allowing direct execution of the `update_activity()` function. This facilitates easier testing, debugging, and manual runs of the activity update process without needing to import the module elsewhere.
… (activity-refactor) This new GitHub Actions workflow automates the regular synchronization of game activities. It runs daily to execute `activity_updater.py`, ensuring that the script always uses the latest game data. This reduces manual intervention and keeps the repository's activity data fresh.
The workflow name was updated for conciseness and to adopt a more programmatic naming convention. This makes the name easier to read and reference within the GitHub Actions UI and logs.
… add output function (activity-refactor) Introduces a data merging strategy for activity information, prioritizing BAWiki, then SchaleDB, and finally Gamekee API. This ensures the most complete and accurate data is used. Adds logic to prevent redundant file updates if no changes are detected in the activity data. The output JSON now maintains a consistent key order for better readability and stability.
…rmat (pr-activity-refactor) Redirect the activity update script's console output to a Markdown log file. This enhances observability by persisting detailed information about API responses and the final merged data. The output format has also been improved with Markdown headers, code blocks, and direct links to the data sources, making the log easier to read and understand. The new log file is ignored by Git to prevent unnecessary commits.
The workflow now automatically copies the newly generated `tmp_activity.json` to `activity.json` upon successful update. An update log (`activity_update_log.md`) is now uploaded as an artifact for review. A pull request is automatically created if the activity data is updated, using the update log as the PR body. This streamlines the process of keeping activity data current and reduces manual intervention for publishing updates.
…actor) Replaced direct assignment to sys.stdout/stderr with contextlib.redirect_stdout and redirect_stderr. This ensures output streams are safely restored, even if errors occur, preventing state leakage and improving robustness. Additionally, updated file path construction to use os.path.join and os.path.dirname(__file__). This makes the script more reliable by resolving file paths relative to the script's location, ensuring it functions correctly regardless of the current working directory.
Owner
Contributor
Author
|
Owner
|
Contributor
Author
|
2.我强调的要点核心在于logging库过大且无必要,目前不能在控制台输出的原因在于我完全重定向了输出流,这的确有不妥之处,我也承诺修改,并且观察actions用时大约30s,很小的脚本用不上logging库的内容,况且输出的内容本就少
3.我的理解能力属实不强,不太能理解“交错”大概是怎样的交错?能否给出一个例子?而确实考虑到活动同时开启的情况(除了国服赶进度有可能外见的实在不多),所以只有活动是按照列表的形式(但是其中一个函数的设置是只有一个活动的时候直接拆开,考虑到代码需要,可以修改),其他均为对象(因为不可能同时开启两个总力战,etc.),故在目前情况完全可以正常使用,因此,我推测加入未开启活动是为了避免开发者未及时更新的问题,除此之外我想象不出其他问题
ps.我想了一下,或许你是在说留存体力的问题?介于个人游玩习惯,我平时不留存体力,同时也认为这会是一个比较小众的功能(当然这是我主观见解),我还是希望这样功能的加入参考一下群友的意见
…________________________________
From: pur1fy ***@***.***>
Sent: Saturday, September 13, 2025 3:56:06 PM
To: pur1fying/blue_archive_auto_script ***@***.***>
Cc: Minami Pumpkin ***@***.***>; Author ***@***.***>
Subject: Re: [pur1fying/blue_archive_auto_script] feat(activity-updater): Add activity updater to automatically fetch activity info. (PR #388)
[https://avatars.githubusercontent.com/u/139786997?s=20&v=4]pur1fying left a comment (pur1fying/blue_archive_auto_script#388)<#388 (comment)>
1. 上述格式问题大致有数,本版本是先可运行来考虑的,很多异常处理都没有做,后续会再重构优化
2. 我个人反对使用logging库,因为没有必要。首先该模块日志量不大,且也并不是作为baas的函数来运行,作为一个简单的脚本加入logging库并无必要。关于md格式,在处理之初是思考着复用到pr的body上来设计的,的确缺失了很多日志,这部分后续会修改
3. 与其关注是否加入未开放的活动,当下更应该解决的问题是 a.维护者能否及时检查合并新的活动数据 b.后续函数具体设计。 显然,加入未开放的活动有利于开发者未及时更新的问题,但同时也要考虑代码的设计协调问题。结构调整4,5同样出自以上相同理由,需要更多的考量。如果需要未开放的数据,或许一个新的结构会是更好的答案
1. 用logging库是需要在控制台及时看到日志, 由于api下载的数据较多, 运行一次脚本耗时较长, 如果在github action运行, 要等完全运行完毕才能看到上传的日志, 无法实时关注运行状态
2. 你没有理解这个pr的意义, 更新活动信息是为了让BAAS在不同活动交错开启时选择性的消耗体力, 记录的活动时间范围越大越好, 而不是只记录运行这个脚本时的活动状态
―
Reply to this email directly, view it on GitHub<#388 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKNXZYYXAXYNOB4NW7VH4SD3SPEZNAVCNFSM6AAAAACGEKTZDWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEOBXG42TSMRUGY>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Owner
|
Contributor
Author
|
2.我承认你说的有一点道理,但问题在于我输出文件并不是保存日志的需要,我只是通过输出md的方式生成了pr的body,方便后面actions读取。从理论上来说我并不需要这样的步骤。最重要的是,这个脚本输出量很少,而且也不在用户端层面,使用简单print更高效
3.你回复的我大致明白,我的疑惑点在于这项功能已经实现了,我相信这个结构也是易懂的,只需要判断是否为1就可知有没有活动,同时完全int的存储也方便套用公式计算效率,我依然不明白为何
现在与需求有何冲突,麻烦再详细指出一下吧
…________________________________
From: pur1fy ***@***.***>
Sent: Saturday, September 13, 2025 6:43:03 PM
To: pur1fying/blue_archive_auto_script ***@***.***>
Cc: Minami Pumpkin ***@***.***>; Author ***@***.***>
Subject: Re: [pur1fying/blue_archive_auto_script] feat(activity-updater): Add activity updater to automatically fetch activity info. (PR #388)
[https://avatars.githubusercontent.com/u/139786997?s=20&v=4]pur1fying left a comment (pur1fying/blue_archive_auto_script#388)<#388 (comment)>
1. logging是标准库, 不存在大不大的问题, 目前场景需要同时写入文件和控制台就是它最佳使用时机
2. 活动不只是游戏里有特殊货币的活动, 还包括 普通图 / 困难图 / 特殊委托 的 双倍 / 三倍, 要实现的效果, 举一个简单的例子, 在仅有特殊委托双倍开启时把所有体力投入特殊委托, 而在仅有普通图双倍时把体力扫荡普通图, BAAS在不同活动开启时将体力投入最高收益的活动, 可以理解吗?
―
Reply to this email directly, view it on GitHub<#388 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKNXZY5N7AW4LICFIE53KTL3SPYLPAVCNFSM6AAAAACGEKTZDWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEOBYGA3TOMZUGY>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
…c (pr-activity-updater) Integrate header mapping and column management directly into `_fetch_activity_table`, removing the redundant `_table_transform` helper function. Introduce `DEFAULT_HEADER_MAP` for consistent column renaming and dropping across various activity tables. This refactoring adds a `force_list` parameter to `_fetch_activity_table` for flexible return types and streamlines activity object creation in `update_activity_bawiki`. This refactoring also removes redundant codes in `update_activity_gamekee_api`
Consolidate localization data and simplify activity parsing logic. This commit refactors the activity data processing by: - Introducing a unified `localization_dict` for event and raid names, reducing redundant data structures. - Simplifying the logic for assigning raid data to the result dictionary using a `raid_type_translator`. - Renaming `regularized_activity` to `activity_info` for better clarity and consistency. - Standardizing time variable names to `begin_time` and `end_time`. - Removing unnecessary trailing commas in requests headers.
…vability Replaced ad-hoc print statements with structured logging for better output management and debugging. Introduced a retry mechanism for network requests to improve robustness against temporary network issues. Added comprehensive error handling, including exiting with an error code on failure, which is beneficial for CI/CD pipelines. Automated the generation of a detailed pull request markdown body, including a diff of activity.json changes, to streamline code reviews and provide clear context for updates.
…flow * Initial plan * Add maintainer notification to sync_activity workflow Co-authored-by: Nanboom233 <[email protected]> * Clean up __pycache__ and update .gitignore Co-authored-by: Nanboom233 <[email protected]> * fix: Only notify repository owner for activity sync PRs Co-authored-by: Nanboom233 <[email protected]> * fix: Dynamically read repository owner for notifications Co-authored-by: Nanboom233 <[email protected]> * chore(activity-updater): Discard an unnecessary .gitignore commit --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Nanboom233 <[email protected]>
Contributor
Author
|
1.refactor,合并大量相似方法 |
Contributor
Author
|
基本功能已经完成,该pr的目标也完成 |
Contributor
Author
|
目前刷取倍数获取疑似还有些问题 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

after u2 update
check #318