instance_id
stringlengths
10
65
repo
stringlengths
5
59
pr_number
int64
1
313k
task_type
stringclasses
1 value
base_commit
stringlengths
40
40
review_commit
stringlengths
40
40
title
stringlengths
2
282
body
stringlengths
7
3k
patch
stringlengths
202
204k
n_defects
int64
1
72
n_supported
int64
1
65
n_major
int64
0
32
defects
stringlengths
140
18.8k
certifier_count
int64
HubSpot__Singularity__1720
HubSpot/Singularity
1,720
defect
07a6d0f3d4e75004712a4e8bc9053b2a81ca8553
7cbedbaf3ee040a8309ca59aacf0c2a31003a632
Account for expected usage when scoring offers
Right now it's possible for us to easily overload a fairly empty machine if we have lots of tasks to schedule. The way the score is calculated, we don't account for other tasks we may have _just_ scheduled. This adds the reserved and last recorded max usage to factoring into scoring, updating those after each task is a...
diff --git a/SingularityBase/src/main/java/com/hubspot/singularity/MachineLoadMetric.java b/SingularityBase/src/main/java/com/hubspot/singularity/MachineLoadMetric.java new file mode 100644 index 0000000000..ee6b518bb6 --- /dev/null +++ b/SingularityBase/src/main/java/com/hubspot/singularity/MachineLoadMetric.java @@ -...
1
1
1
[{"id": "G0", "claim": "The LOAD_15 and LOAD_5 cases in getSystemLoadMetric() return the wrong load values: LOAD_15 returns the 5-minute load and LOAD_5/default returns the 15-minute load, so the switch mapping is swapped.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduced"}]
null
HubSpot__Singularity__1735
HubSpot/Singularity
1,735
defect
48f5435b88f87a1dbe332f1bdf748c120c4fa1a1
2e22ca8329f146ed3b9cbbdbb28b899d2757e414
Add the ability to shuffle long running tasks when a host is overloaded
It is very common to oversubscribe on resources to use fewer large hosts more efficiently. Unfortunately that can have unintended consequences like overloading a host's cpu or oom-ing if memory is oversubscribed too much. This PR tackles the first of those cases (cpu). During our usage polling, we will check the system...
diff --git a/SingularityBase/src/main/java/com/hubspot/mesos/json/MesosSlaveMetricsSnapshotObject.java b/SingularityBase/src/main/java/com/hubspot/mesos/json/MesosSlaveMetricsSnapshotObject.java index 7d5ccb8b58..6d71402d73 100644 --- a/SingularityBase/src/main/java/com/hubspot/mesos/json/MesosSlaveMetricsSnapshotObjec...
2
1
0
[{"id": "G0", "claim": "If this line is reached, slaveOverloaded must be true and slaveOverloaded is only true when used > total, so cpuOverage <= 0 should be an error; if the check is kept it should log an error.", "category": "correctness", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", ...
null
HubSpot__Singularity__1776
HubSpot/Singularity
1,776
defect
f7c133fdf91cc8f394c94188bf7dc5ed1693a266
7ff49c1001dee738f042314966ddf01a09231aea
Configurably omit offers from hosts that are overloaded
If, according to the metrics collected from the slave metrics endpoint, a slave is overloaded, omit these offers from scoring and do not schedule tasks there. This feature is configurable via `omitOverloadedHosts` under the `mesos` config, and defaults to `false`/off Overloaded is currently defined as a load5 > 1.0 ...
diff --git a/SingularityBase/src/main/java/com/hubspot/singularity/SingularitySlaveUsage.java b/SingularityBase/src/main/java/com/hubspot/singularity/SingularitySlaveUsage.java index 424d2c6076..8388adfab1 100644 --- a/SingularityBase/src/main/java/com/hubspot/singularity/SingularitySlaveUsage.java +++ b/SingularityBas...
2
2
0
[{"id": "G0", "claim": "The hardcoded overload thresholds (systemLoad5Min > 1.0, systemLoad1Min > 1.5) should be made tunable configuration knobs for flexibility.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new LOG.debug statement has a '{}' place...
null
HubSpot__Singularity__1811
HubSpot/Singularity
1,811
defect
16e4b577ec13ef170c166e7035296824ae1144d7
f5b3a0f320eee2c7b77371c1b17df50de9bb4ad4
Create task cleanups for scale down at request update time
We can run into a certain sate where consistent continuous instance numbers are not kept. If a cleanup is created between a request scaling down and the scheduler processing the pending request update, this can occur. This PR creates the task cleanups for the specific instances that need to be cleaned up at request upd...
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/resources/RequestResource.java b/SingularityService/src/main/java/com/hubspot/singularity/resources/RequestResource.java index a25cb79e28..735c24d094 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/resources/RequestResource.java...
1
1
1
[{"id": "G0", "claim": "The comparison guarding the scale-down cleanup should have its operands swapped (old instances < new instances triggers the cleanup branch when a scale-down is the actual case).", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduced"}]
null
HubSpot__Singularity__1814
HubSpot/Singularity
1,814
defect
5342de1b411fe5513e5c89aa38b5e9b3522746a2
25be9f8ec1ca7be4480b8f713ceae8553ba76286
Updated logrotate frequency to allow for an override
To use this feature add additional file/file groups (via wildcard) and times to AdditionalLogrotateFile.
diff --git a/SingularityBase/src/main/java/com/hubspot/singularity/executor/SingularityExecutorLogrotateFrequency.java b/SingularityBase/src/main/java/com/hubspot/singularity/executor/SingularityExecutorLogrotateFrequency.java index 6562a0f1f2..5740667d93 100644 --- a/SingularityBase/src/main/java/com/hubspot/singulari...
3
3
2
[{"id": "G0", "claim": "The fields and getters of SingularityExecutorLogrotateAdditionalFile should use the same Optional types: extension, dateformat and frequencyOverride should be Optional in both their member types and their getter types (Jackson deserializes a missing key to an absent Optional).", "category": "des...
null
HubSpot__Singularity__1849
HubSpot/Singularity
1,849
defect
2c77825acf1cd5929029cb678ecb71172ac8e566
e895fcb104fe51a894fd969aad49690a8a50880b
Slave attribute minimums
Allows a minimum number of tasks on slaves with a certain attribute
diff --git a/SingularityBase/src/main/java/com/hubspot/singularity/SingularityRequest.java b/SingularityBase/src/main/java/com/hubspot/singularity/SingularityRequest.java index df5f1f804b..3c0c7f13cb 100644 --- a/SingularityBase/src/main/java/com/hubspot/singularity/SingularityRequest.java +++ b/SingularityBase/src/mai...
2
2
1
[{"id": "G0", "claim": "No new enum case is needed for the minimums-infeasible return — the existing SLAVE_ATTRIBUTES_DO_NOT_MATCH enum is fine, so the `// TODO: other enum?` marker can go.", "category": "design", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "getNumInstancesWi...
null
HubSpot__Singularity__1886
HubSpot/Singularity
1,886
defect
ca3965a293681cb8d30a27a7ba6bb90271c2d4c6
5d2f6765766f5c851958639796de75c76dba5cb1
Syncing upstreams between load balancer and singularity
We recently had a critsit due to duplicate upstreams. The SingularityUpstreamsPoller runs every 10 minutes. Wrote a poller to sync between Singularity and Baragon (load balancer) to automatically fix this issue on a recurring basis. It fetches upstreams from active & healthy tasks in Singularity and upstreams in Barago...
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/config/SingularityConfiguration.java b/SingularityService/src/main/java/com/hubspot/singularity/config/SingularityConfiguration.java index 7889c9ba7f..ae0723a193 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/config/Singularity...
7
7
2
[{"id": "G0", "claim": "The new public getters on LoadBalancerClientImpl are unnecessary and should not be public since the private fields could be used instead.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The checker should compare upstreams one serv...
null
HubSpot__Singularity__1907
HubSpot/Singularity
1,907
defect
ca3965a293681cb8d30a27a7ba6bb90271c2d4c6
cf752184908a1ff835152fd5de9407a51ed8eacb
On demand requests with instances shouldn't trigger task lag over instance count
Currently, if you submit pending tasks in quick succession on an on demand request that has an instance count limit, you can end up with tasks that will wait for the first to complete before launching. We shouldn't page for task lag in these cases. [We previously separated the late tasks from on-demand requests fro...
diff --git a/SingularityBase/src/main/java/com/hubspot/singularity/SingularityRequest.java b/SingularityBase/src/main/java/com/hubspot/singularity/SingularityRequest.java index 3c0c7f13cb..602e3ffe0f 100644 --- a/SingularityBase/src/main/java/com/hubspot/singularity/SingularityRequest.java +++ b/SingularityBase/src/mai...
4
4
3
[{"id": "G0", "claim": "The @Schema description of getInstances should be an addition describing both uses (a count of tasks for long-running requests and the concurrency limit for on-demand requests) rather than a replacement that only mentions on-demand requests.", "category": "documentation", "verdict": "supported",...
null
HubSpot__Singularity__1932
HubSpot/Singularity
1,932
defect
4a3ae3a77e48a53d1126cc58aa584bebbb8ac4c6
3f655bb4dceedd5eb444244758596117f7d6313c
Refactor calling of offer evaluation
While looking into some odd offer issues, I noticed that our invocations of checking offers differed slightly between the SchedulerImpl and the SchedulerPoller. This does two things: - Consolidates all offer evaluation logic for new and cached offers in the SingularityMesosOfferScheduler class, so the same logic is ca...
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/helpers/MesosUtils.java b/SingularityService/src/main/java/com/hubspot/singularity/helpers/MesosUtils.java index 2473efb46d..a213ea9ca1 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/helpers/MesosUtils.java +++ b/SingularitySer...
3
3
1
[{"id": "G0", "claim": "Fix the old typo in the local variable name `delclineImmediately` (misspelled \"decline\").", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "pre_existing"}, {"id": "G1", "claim": "The invalid-offer LOG.warn statements have an {} placeholder but pass no argumen...
null
HubSpot__Singularity__2016
HubSpot/Singularity
2,016
defect
eddf792608eb838ced8d3acc67d4bbbe04be9f11
f8cce46ae0f5bc4e955bd8e4e374eaaf41dd686f
Ensure delayed oneoff tasks get rescheduled on new deploy
Right now we clean all pending tasks not belonging to the active deploy. However, for a oneoff that a user may have scheduled for a few hours in the future. They expect that task to still run. This recreates the task under the updated active deploy id
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/resources/TaskResource.java b/SingularityService/src/main/java/com/hubspot/singularity/resources/TaskResource.java index 775de32387..c1a5a0b899 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/resources/TaskResource.java +++ b/Si...
1
1
0
[{"id": "G0", "claim": "The taskIds list assigned in getScheduledTaskIds may not be mutable, so it would be safer to return a sorted copy instead of sorting it in place.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
HubSpot__Singularity__2029
HubSpot/Singularity
2,029
defect
deeed609700c49cbee1d9a7188974467096f5b3a
3d8a4ef1f1b3e11712b5b93d7b72904fcdef500b
Timing-related fixes
Few that will be in this PR - [x] When skip healthchecks expires, any tasks that were initially marked healthy due to that should remain as healthy. Accomplishing this with a dummy healthcheck result, since pulling in request history to check at the time of startup would pull a dep on mysql on the critical scheduling ...
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/hooks/LoadBalancerClientImpl.java b/SingularityService/src/main/java/com/hubspot/singularity/hooks/LoadBalancerClientImpl.java index 580321b3d3..bf603f64ab 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/hooks/LoadBalancerClient...
1
1
0
[{"id": "G0", "claim": "The already-enqueued state should be detected in a cleaner way than matching the Baragon error message string, or failing that, the matched string should be moved into a constant.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
HubSpot__Singularity__2050
HubSpot/Singularity
2,050
defect
2b3aa5ecb86bd15887b7ed27773949ecae26398b
d92e4ba8a1a268fcbec9a47a8966b1fb7926dfc7
Better preferential scheduling
### Status: Work in progress :construction: <!-- - Ready to merge :rocket: - Work in progress :construction: - Under/ready for review :microscope: - Waiting on dependencies :hourglass: - Do not merge :no_good: --> #### Description Mesos hosts aren't nearly as well utilized as they could...
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/mesos/SingularityMesosOfferScheduler.java b/SingularityService/src/main/java/com/hubspot/singularity/mesos/SingularityMesosOfferScheduler.java index 4b0178031a..45f0a377de 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/mesos/Si...
2
2
1
[{"id": "G0", "claim": "Avoid doing the allowed/required attribute comparison and score-boost calculation a second time in the scoring code by communicating the preference back through SlaveMatchState (e.g. a PREFERRED_SLAVE state) instead of recomputing it.", "category": "performance", "verdict": "supported", "priorit...
null
HubSpot__Singularity__2057
HubSpot/Singularity
2,057
defect
58000e23adc3856ab34dded1dc9a67e899ceb229
e5fbb6bc2dfa9f89ff521e813dfd315aa26a71f1
Slightly Smarter Task Shuffling
The current task shuffling/eviction logic used by Singularity prioritizes shuffling tasks with the highest resource utilization (memory or CPU, depending on which is most overused), on each overcommitted slave. Though this is a good way to ensure the shuffle succeeds at reducing load to acceptable levels, it is also mu...
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularitySchedulerModule.java b/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularitySchedulerModule.java index 7d1c41e499..c7b0dc68e1 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/schedule...
3
2
1
[{"id": "G0", "claim": "The actionId in the task cleanup and the one in the SingularityPendingRequest created by bounce() should match, to make it easier to trace through the data for debugging (reviewer notes it has no lasting effect on the actions themselves).", "category": "maintainability", "verdict": "supported", ...
null
HubSpot__Singularity__2088
HubSpot/Singularity
2,088
defect
715b7a85d6a1e8c15ed79f1566505a928eaf0474
8428b9fa07dfb1292c430129d73ecef73a082ccf
Allow service module override
Allows us to do things like add in an override module or override the db connections. WIP
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/SingularityService.java b/SingularityService/src/main/java/com/hubspot/singularity/SingularityService.java index 2ad9a570ec..78f3df98a3 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/SingularityService.java +++ b/SingularitySer...
1
1
0
[{"id": "G0", "claim": "Add a get method for the SingularityAuthModule as well, for consistency with the newly added getServiceModule().", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}]
null
HubSpot__Singularity__2100
HubSpot/Singularity
2,100
defect
d91ba6ec8ec8790d18a046d7e3ac5328323e4892
a788c1f055d0da11fbaa3b8af722351a3a12538e
Additional deploy validation
Two main pieces: - Add the ability to lock down artifact specification to only signed artifacts (s3 + signature file). This does not validate everything within a list, assuming that if the list is signed, the things within the list are valid - Add valid docker registry list so Singularity can lock usage down to only ...
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/config/SingularityConfiguration.java b/SingularityService/src/main/java/com/hubspot/singularity/config/SingularityConfiguration.java index 274b2ac86f..97b0f18aff 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/config/Singularity...
1
1
0
[{"id": "G0", "claim": "The error message for a disallowed docker registry should include the list of allowed registries so the failure is obvious.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
HubSpot__Singularity__2128
HubSpot/Singularity
2,128
defect
efeddbbad35bcfea457940a246af0f02c79c2d9c
fe5a12cd3ea38d56f849ec5035353a17e0956dc6
Make crash loops resolve faster
Currently we bucket failures into time windows. For example: |O|O|X|X|O|O|O|O| and we take into account the number of overall buckets that have failures. However, the one piece I thought the code compensated well for, but does not is that there is a very big difference between: |X|X|O|O|O|O|O|O| and |O|O...
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/config/CrashLoopConfiguration.java b/SingularityService/src/main/java/com/hubspot/singularity/config/CrashLoopConfiguration.java index 12e6ffc461..7ebec5a915 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/config/CrashLoopConfig...
2
2
0
[{"id": "G0", "claim": "The newly added bucket-thresholds collection should be a List rather than an array.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The inline comment on the 75% minBucketIndexPercent fields wrongly says the failure must b...
null
HubSpot__Singularity__2129
HubSpot/Singularity
2,129
defect
6b551a054e444af71001477d9a31fbfd8148a859
098ecff7874b902f79585df7576852e44763047d
Don't reactivate tasks on agent reregistration after lb removal
If an agent re-registers with mesos, but the task has already started being removed from the load balancer, don't reactivate it. Instead, clean it gracefully.
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/mesos/SingularityMesosStatusUpdateHandler.java b/SingularityService/src/main/java/com/hubspot/singularity/mesos/SingularityMesosStatusUpdateHandler.java index 2f59d7c3ed..5105940384 100644 --- a/SingularityService/src/main/java/com/hubspot/singularit...
4
3
3
[{"id": "G0", "claim": "TaskCleanupType.PRIORITY_KILL may not be the right cleanup type for the new reregistration branch — it is an insta-kill, which is too harsh for a graceful cleanup — and a different type such as DECOMISSIONING (or a new type) may fit better.", "category": "design", "verdict": "supported", "priori...
null
HubSpot__Singularity__2147
HubSpot/Singularity
2,147
defect
b18f95e9a7bb821ede4199c0bcfda59adfd03d2a
c5211453b55ab4918d102a9a0e78bb52606e0688
Add actions to group/scope auth
Some requests need to be runnable ONLY by someone other than the group owner for compliance purposes. For example, Team A would write and deploy a sensitive request, and only Team B could run it (or bounce, scale, kill tasks, or pause). This provides a more generic solution in the form of an action permissions overr...
diff --git a/SingularityBase/src/main/java/com/hubspot/singularity/SingularityAuthorizationScope.java b/SingularityBase/src/main/java/com/hubspot/singularity/SingularityAuthorizationScope.java index 46ce57fe31..4d47e8f478 100644 --- a/SingularityBase/src/main/java/com/hubspot/singularity/SingularityAuthorizationScope.j...
4
4
0
[{"id": "G0", "claim": "Making each capability bundled in EXEC (run, bounce, kill, pause, scale) its own separate scope instead of one coarse scope would make it much easier to divide things up later.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The DE...
null
HubSpot__Singularity__2175
HubSpot/Singularity
2,175
defect
1c455b4147411c4a6e65dbaf8b791bbd75aaaf58
7dfa4e4acbd6bd00b2e850eaecc12e03fcc417fc
Throw exception to resubscribe to mesos
Sometimes there's an issue connecting to Mesos master and the alert that went off was a Mesos4xxException, stating that the framework is no longer subscribed to master. When that happens, we want to throw an exception to be picked up by the `SingularityMesosSchedulerImpl` to pause and reconnect. This is done on a separ...
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/mesos/SingularityMesosSchedulerClient.java b/SingularityService/src/main/java/com/hubspot/singularity/mesos/SingularityMesosSchedulerClient.java index fba4ebbd94..c887681b07 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/mesos/...
1
1
1
[{"id": "G0", "claim": "The resubscribe trigger should not be at the mercy of the exact exception message string: it should apply whenever a Mesos4xxException with a 403 occurs, ideally by comparing the exception's status code as an int instead of a string contains.", "category": "design", "verdict": "supported", "prio...
null
HubSpot__Singularity__2177
HubSpot/Singularity
2,177
defect
caed1dfa483aa23146e2a816d060bac42102afc2
118e55e4cf316ed4fa6f7688777997eab3736688
Clean up lifecycle ordering on shutdown
Realized there were a few cases in here where we could possibly still have blips of multiple leaders or no leaders at a time. In particular the following set of events: - Old leader gets a TERM signal - Old leader fails to properly wait for all scheduled pollers to exit - Old leader relinquishes leadership - New ...
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/SingularityAbort.java b/SingularityService/src/main/java/com/hubspot/singularity/SingularityAbort.java index ea46fd8702..d6ed7bdce9 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/SingularityAbort.java +++ b/SingularityService/s...
1
1
0
[{"id": "G0", "claim": "The new log message misspells 'Executor' as 'Eeecutor' and the typo should be corrected.", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}]
null
HubSpot__Singularity__2240
HubSpot/Singularity
2,240
defect
e69d5793a6931c4dece72098a8b60171e93147a3
b1f59f8f5372a81ee89af90018f737589d2da350
Cleanup hosts marked as missing on startup
This PR modifies the `SingularityAgentReconciliationPoller` to delete hosts that are marked as missing on startup. Previously, only hosts marked as dead were deleted by the poller, causing inactive hosts marked as missing on startup to still appear in Singularity. Hosts that are dead or missing on startup are delete...
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityAgentReconciliationPoller.java b/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityAgentReconciliationPoller.java index a7b5838cb1..dbf9e4adc8 100644 --- a/SingularityService/src/main/java/com/hubspot/...
3
3
2
[{"id": "G0", "claim": "The addition of the testMissingSlavesArePurged test makes testDeadSlavesArePurged fail when it is run after it (it passes on its own), apparently because shared state such as overlapping agent ids and the deleteDeadAgentsAfterHours configuration is not reset between tests.", "category": "testing...
null
HubSpot__Singularity__2244
HubSpot/Singularity
2,244
defect
df03e6ca4821d08e3220b6745c5be6395731ed2c
dafed78469934c3c0af62291686937ba2723fafb
Avoid Request Locks With Task Lag
This PR prevents request locks from being acquired by lower priority possibly long running components while the request has late pending tasks, to allow higher priority components like the offer scheduler to acquire them. It does not preempt lower priority components, so lag for a request may still build up while they'...
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/data/history/SingularityDeployHistoryPersister.java b/SingularityService/src/main/java/com/hubspot/singularity/data/history/SingularityDeployHistoryPersister.java index 6c5e68b7f1..5dbd0cdf16 100644 --- a/SingularityService/src/main/java/com/hubspot/...
3
1
1
[{"id": "G0", "claim": "Question whether reusing the request cache TTL is the right knob for throttling the guardrail's late-task refresh, and whether the guardrail should be running on the leader only.", "category": "design", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "isLa...
null
HubSpot__Singularity__2246
HubSpot/Singularity
2,246
defect
76c383f587c22cd1ce21b2c837046326c8b3b2d5
a7627e34d3bf126a4b983efe9376bec0f7cd9474
Add request-level maximum scale option
This adds a maximum scale option at the request level for users to specify the maximum number of instances allowed for a particular request. Previously, there only existed a global limit in `MesosConfiguration` to prevent overscales that applied to all requests. https://git.hubteam.com/HubSpot/PaaS-Run/issues/1546
diff --git a/SingularityBase/src/main/java/com/hubspot/singularity/SingularityRequest.java b/SingularityBase/src/main/java/com/hubspot/singularity/SingularityRequest.java index c8ad06de0b..69593cbe6c 100644 --- a/SingularityBase/src/main/java/com/hubspot/singularity/SingularityRequest.java +++ b/SingularityBase/src/mai...
3
3
1
[{"id": "G0", "claim": "AutoScale scales requests through checkScale, which does not enforce the new max scale limits, so the checkBadRequest for max scale should also be added to checkScale (or a shared checkBadScaleRequest method used by both validator paths) so that AutoScale is blocked.", "category": "correctness",...
null
HubSpot__Singularity__2275
HubSpot/Singularity
2,275
defect
74279ca26d692fbd0f4a9208238cb675c3543b74
deeb4c9777b366bd423886b0a5b5846791f5d1b7
Prevent accidental large scale downs
Definitely open to different logic, thresholds, etc. Just wanted to get something out here to start a discussion around.
diff --git a/SingularityBase/src/main/java/com/hubspot/singularity/SingularityRequest.java b/SingularityBase/src/main/java/com/hubspot/singularity/SingularityRequest.java index 69593cbe6c..ea002c60d6 100644 --- a/SingularityBase/src/main/java/com/hubspot/singularity/SingularityRequest.java +++ b/SingularityBase/src/mai...
2
2
0
[{"id": "G0", "claim": "The two scale-down error messages should mention that the scale-down is allowed with explicit acknowledgement, making obvious which field has to be set.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The hardcoded maximum s...
null
HubSpot__Singularity__500
HubSpot/Singularity
500
defect
fde16e5670ecae8cc91bc5abd19555ddd4eff2d4
82e0beb22438b2fcad75e1cf811800875cff21db
less lb cleanup, more lb updates, noop should be load_balance_failed
@tpetr a few of the lb improvements separated out from baragon client PR
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityCleaner.java b/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityCleaner.java index 9883651c54..cd8eb513e6 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityCle...
2
1
1
[{"id": "G0", "claim": "Returning LOAD_BALANCE_FAILED for an INVALID_REQUEST_NOOP LB removal may cause the cleanup to retry forever.", "category": "correctness", "verdict": "opposed", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The added task.isPresent() && isLoadBalanced() guard skips creating the...
null
HubSpot__Singularity__546
HubSpot/Singularity
546
defect
c523e84a6675461d4deb0c9ca774327bd57134ad
8c0365eac4505c2b99ea3a347f68247cdd675b6b
Include cleaning tasks when checking for SEPARATE placement
Allows us to do a bounce without having the cleaning and starting tasks on the same host
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/mesos/SingularitySlaveAndRackManager.java b/SingularityService/src/main/java/com/hubspot/singularity/mesos/SingularitySlaveAndRackManager.java index 19d14e9d9c..98d0bf215d 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/mesos/Si...
5
5
2
[{"id": "G0", "claim": "Including cleaning tasks in the offer-match loop makes them affect rack placements and changes the task counting mechanism beyond the intended SEPARATE placement check.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The pull ...
null
HubSpot__Singularity__694
HubSpot/Singularity
694
defect
755e2922f5d478a14449f660fb7e611fba457b90
14780bd03a666aa84625d17f538bcb5acbe09834
Remove paused requests from LB
Now that Baragon supports the `DELETE` request action for a few releases, this introduces lb cleanup for paused requests. Since our current LB cleanup queue is very task based, it would be difficult to accurately determine from a task's point of view that a request could be deleted form the LB. So, I implemented a requ...
diff --git a/SingularityBase/src/main/java/com/hubspot/singularity/JsonHelpers.java b/SingularityBase/src/main/java/com/hubspot/singularity/JsonHelpers.java index 92274db132..c09e7e454b 100644 --- a/SingularityBase/src/main/java/com/hubspot/singularity/JsonHelpers.java +++ b/SingularityBase/src/main/java/com/hubspot/si...
4
2
1
[{"id": "G0", "claim": "The import of com.google.common.base.Optional added to LoadBalancerClient.java is unnecessary.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Asking what getLoadBalancerState() returns if called after createLBCleanupReque...
null
HubSpot__Singularity__747
HubSpot/Singularity
747
defect
f150e8c3a97d1449ec520b80dd23b075e48f8c8d
b2cca1d93aee46694b41a092153adcf7cd733573
Attribute placement
Going to complete this a bit more and add some better messaging so we can know when/why tasks might be/not be getting placed. Maybe along the lines of something that will help solve #636 as well Overall adds a few things: - Singularity will keep track of all attributes for a slave, not just rack - you can reserve slav...
diff --git a/Docs/details.md b/Docs/details.md index 6f4f530950..a55195a4cd 100644 --- a/Docs/details.md +++ b/Docs/details.md @@ -52,6 +52,14 @@ When matching a Mesos resource offer to a deploy, Singularity can use one of sev - `SEPARATE_BY_REQUEST`: ensures no two tasks belonging to the same request (regardless if d...
4
4
1
[{"id": "G0", "claim": "Use EnumMap instead of HashMap for the unmatchedOffers map keyed by SlaveMatchState in SingularityPendingTask.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "reserveSlavesWithAttributes should be a Map<String, List<String...
null
HubSpot__Singularity__837
HubSpot/Singularity
837
defect
bdf10f48f736de643ff83500ee73276683de0ccc
a386c9f969a9093401eedcbe3f71e65315191774
make sure literal host ports are processed correctly
A few things to fix ports/params with docker: - Make sure any port with a `LITERAL` mapping also gets added to the mesos Resources when building the task - Verify during `doesOfferMatchResources` that any requested literal host ports are present in the offer - Add a scheduler test for port resources - Make sure docker ...
diff --git a/SingularityBase/src/main/java/com/hubspot/mesos/MesosUtils.java b/SingularityBase/src/main/java/com/hubspot/mesos/MesosUtils.java index d658f83f11..72049fa253 100644 --- a/SingularityBase/src/main/java/com/hubspot/mesos/MesosUtils.java +++ b/SingularityBase/src/main/java/com/hubspot/mesos/MesosUtils.java @...
1
1
0
[{"id": "G0", "claim": "Remove the space inside `portsSoFar --;` for clarity.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}]
null
HubSpot__Singularity__871
HubSpot/Singularity
871
defect
3faabdaf783090d806d2afc0b52194e467a5f123
49f089c15bf93a9b5d7b32dcf9bff284dd317ab7
add support for override defaults file
This PR adds support for pulling in an additional Singularity configuration file which overrides values from the default one. This is useful if you need to lock down S3 / database / LDAP credentials but would like the other settings to have looser read/write permissions.
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/SingularityService.java b/SingularityService/src/main/java/com/hubspot/singularity/SingularityService.java index 99c127cf51..2321c4644b 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/SingularityService.java +++ b/SingularitySer...
1
1
0
[{"id": "G0", "claim": "jhaber asks whether, when a field is an array in both the base and the override configuration, the merge behaviour should be to append the override's items or to overwrite the base's array.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
HubSpot__Singularity__887
HubSpot/Singularity
887
defect
a6dab03f3aac0000520acebd322432bbcfabbe2d
0ace1e30e86c531f88b4634a6ce941c6b5c8c7bb
allow deploy to specify port index for healthchecks and LB api
On the deploy you can specify `loadBalancerPortIndex` or `healthcheckPortIndex` (e.g. `0` for first allocated port, `1` for second allocated port). Defaults to 0 if not specified /fixes #886
diff --git a/SingularityBase/src/main/java/com/hubspot/singularity/SingularityDeploy.java b/SingularityBase/src/main/java/com/hubspot/singularity/SingularityDeploy.java index 29cb518fce..4a20e3500f 100644 --- a/SingularityBase/src/main/java/com/hubspot/singularity/SingularityDeploy.java +++ b/SingularityBase/src/main/j...
5
5
3
[{"id": "G0", "claim": "The new healthcheckPortIndex field's API documentation should indicate that it defaults to the first port.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The misspelled local variable healthecheckPort in SingularityHealthch...
null
HubSpot__Singularity__971
HubSpot/Singularity
971
defect
5532749ef117ff4995747af37b41b74aa8a116dd
24811cf9132dd9bb7a40de0b011ca2ad521d6552
ability to update request data upon successful deploy
Currently, if you want to change the scale of a service (or any other request-level setting) as well as deploy new code, you need to do this in two separate steps. This PR adds an optional `newRequestData` field to the `SingularityDeployRequest`. If present, it will be added to the pending deploy so that the scheduler ...
diff --git a/SingularityBase/src/main/java/com/hubspot/singularity/SingularityPendingDeploy.java b/SingularityBase/src/main/java/com/hubspot/singularity/SingularityPendingDeploy.java index 259aae1329..5e5d46bf23 100644 --- a/SingularityBase/src/main/java/com/hubspot/singularity/SingularityPendingDeploy.java +++ b/Singu...
4
3
0
[{"id": "G0", "claim": "The `newRequestData` field added to `SingularityPendingDeploy` is awkwardly named; `updatedRequest` would make more sense.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The updated request data should live on the `Singul...
null
HubSpot__hubspot-cli__1123
HubSpot/hubspot-cli
1,123
defect
95f60b605a3fe9370efff9365f7bb5af77e415a4
231e3f6a2d2f99b58e2d8f48c0aaa8992c3e5050
Refactor(config): Sister PR in local-dev-lib
## Description and Context We are updating our HubSpot CLI configuration file, so that it will be created the root directory in a hidden folder: `~/.hubspot/config.yml`. This will encourage users to take advantage of the `init`, `auth`, and `accounts` commands to update their config and help prevent config-related bug...
diff --git a/packages/cli/commands/auth.js b/packages/cli/commands/auth.js index da2c19415..7f0fa7f71 100644 --- a/packages/cli/commands/auth.js +++ b/packages/cli/commands/auth.js @@ -76,15 +76,15 @@ exports.handler = async options => { setLogLevel(options); logDebugInfo(options); + const env = qa ? ENVIRONME...
5
2
1
[{"id": "G0", "claim": "Reviewer questions whether it still makes sense to check for a config path after the PR moved loadConfig(configPath) above that check in the auth command.", "category": "correctness", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Reviewer asks that, if ...
null
HubSpot__hubspot-cli__1200
HubSpot/hubspot-cli
1,200
defect
a5032157b72f4c7e265531a00851708a7c0b5f56
d45da3f9fad6d7c58dbf8b0cd679045d6240c213
Use workflows in acceptance tests
## Description and Context <!-- Provide a summary of what has changed --> <!-- Provide links to relevant discussions or documentation to promote understanding and addressing this PR --> <!-- Describe any packages you'd like to add and the reasons why. --> This switches up our pattern for acceptance tests from testi...
diff --git a/acceptance-tests/README.md b/acceptance-tests/README.md index 0a9f23ba7..2905e3c17 100644 --- a/acceptance-tests/README.md +++ b/acceptance-tests/README.md @@ -26,7 +26,6 @@ There are 2 ways to pass in necessary configuration to the script. ```bash ACCOUNT_ID="123456789" PERSONAL_ACCESS_KEY="AiRiNGU2Y**...
2
2
1
[{"id": "G0", "claim": "The imports reference `lib/TestState` while the file is still named `testState.ts`, so this works on case-insensitive macOS but will fail to build on case-sensitive OSes.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"id": "G1", "claim": "The emp...
null
HubSpot__hubspot-cli__1226
HubSpot/hubspot-cli
1,226
defect
63787ff3afa816c04e08459ef3a192740bc5ea2f
b06b1baf12d73070aa9d4095037bd3087646472f
Create new prompt for `is_available_for_new_content`.
## Description and Context Developers use the CLI to create a new module locally. The default file structure we provide includes a default value for `is_available_for_new_content` within the meta.json file for the module. This PR just adds a new prompt to the list of prompts for the create module cli command, allowing...
diff --git a/lang/en.lyaml b/lang/en.lyaml index 5d945b8c8..b97682236 100644 --- a/lang/en.lyaml +++ b/lang/en.lyaml @@ -1202,6 +1202,7 @@ en: selectReactType: "Is this a React module?" selectContentType: "What types of content will this module be used in?" confirmGlobal: "Is this a global mo...
4
4
1
[{"id": "G0", "claim": "The wording of the new availableForNewContent prompt message should be adjusted to \"Make this module available for new content?\".", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The pull request description should be sligh...
null
HubSpot__hubspot-cli__1269
HubSpot/hubspot-cli
1,269
defect
b706cc538ba135f413c6d9c559c0a43ccd59a75b
84172a5b60f837f1634e6145188bd96192046ad0
chore!: Rename Mode to CmsPublishMode
## Description and Context See issue: https://git.hubteam.com/HubSpot/hubspot-cli-issues/issues/718 and LDL PR: https://github.com/HubSpot/hubspot-local-dev-lib/pull/216 This updates the CLI to handle LDL's renamed exports related to `CmsPublishMode`. It also changes all references to `mode` in the CLI to `cmsPubl...
diff --git a/acceptance-tests/tests/commands/config.spec.ts b/acceptance-tests/tests/commands/config.spec.ts index c8fd313d2..52032f7e4 100644 --- a/acceptance-tests/tests/commands/config.spec.ts +++ b/acceptance-tests/tests/commands/config.spec.ts @@ -15,7 +15,7 @@ describe('hs config', () => { }); describe('h...
3
3
2
[{"id": "G0", "claim": "In the invalid-mode error message in validateCmsPublishMode, the interpolated `mode` variable needs to be changed to `cmsPublishMode`.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The @hubspot/local-dev-lib dependency pinne...
null
HubSpot__hubspot-cli__1280
HubSpot/hubspot-cli
1,280
defect
154cb197cbb8a80680e346094188517dffdc5a94
da53b4a2a53b953eab0ada84d59acc1f27ffa77e
chore: Clean up buckets and command descriptions
## Description and Context This renames files and directories for the `account` and `secret` commands to be singular, matching the conventions we use everywhere else. It also fixes a few minor copy issues in `en.lyaml` and updates every command `describe` to match our new rules See https://git.hubteam.com/HubSpot/h...
diff --git a/bin/cli.js b/bin/cli.js index 3eedbb981..2400e9834 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -39,7 +39,7 @@ const uploadCommand = require('../commands/upload'); const createCommand = require('../commands/create'); const fetchCommand = require('../commands/fetch'); const filemanagerCommand = require('....
1
1
0
[{"id": "G0", "claim": "Rename the `accountCommand` and `secretCommand` variables to `accountCommands` and `secretCommands` so the bucket names identify them as command buckets.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
HubSpot__hubspot-cli__1342
HubSpot/hubspot-cli
1,342
defect
48e9d585fd83e7c451fcd7dd4b7562257858e377
1d155e9a726f0d55a24978f1b3c3e9194a922a81
Porting the accounts info command to TS
## Description and Context <!-- Provide a summary of what has changed --> <!-- Provide links to relevant discussions or documentation to promote understanding and addressing this PR --> <!-- Describe any packages you'd like to add and the reasons why. --> Porting the `hs accounts info` command to TS. I'm only porti...
diff --git a/commands/account/info.ts b/commands/account/info.ts index 4dd0b5aa9..4fc08c152 100644 --- a/commands/account/info.ts +++ b/commands/account/info.ts @@ -1,41 +1,47 @@ -// @ts-nocheck -const { logger } = require('@hubspot/local-dev-lib/logger'); -const { getAccountConfig } = require('@hubspot/local-dev-lib/c...
5
5
1
[{"id": "G0", "claim": "The builder function should use the `BuilderCallback` type for its signature, as done elsewhere in the repo.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The change may alter the command's behavior; the author confirmed it does ...
null
HubSpot__hubspot-cli__1349
HubSpot/hubspot-cli
1,349
defect
04942cfb4feb1e4a88b5890810204f13895c6f4c
c65a6c1a4e418d6e2f07177cad1c63bfcef64c68
Feature: Staging branch for global config (including migration)
## Description and Context Relies on https://github.com/HubSpot/hubspot-local-dev-lib/pull/228 In this PR, I'm implementing support for default account overrides with the new centralized configuration file. Now, customers can place a `.hs-account` file in any directory where they would like the default account ...
diff --git a/bin/cli.js b/bin/cli.js index 017485619..c95071986 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -13,6 +13,10 @@ const { getConfigPath, validateConfig, } = require('@hubspot/local-dev-lib/config'); +const { + DEFAULT_ACCOUNT_OVERRIDE_ERROR_INVALID_ID, + DEFAULT_ACCOUNT_OVERRIDE_ERROR_ACCOUNT_NOT_FOU...
9
8
1
[{"id": "G0", "claim": "The new user-facing command strings should use the singular form `hs account create-override` instead of `hs accounts create-override`, per the team's preferred usage.", "category": "design", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The raw `logger...
null
HubSpot__hubspot-cli__1353
HubSpot/hubspot-cli
1,353
defect
04942cfb4feb1e4a88b5890810204f13895c6f4c
a35eeeeadd24e86ddd8b755dc8b9747b0633d881
chore: unit tests for polling
## Description and Context <!-- Provide a summary of what has changed --> <!-- Provide links to relevant discussions or documentation to promote understanding and addressing this PR --> <!-- Describe any packages you'd like to add and the reasons why. --> Adding tests for lib/polling. I also made some changes to ma...
diff --git a/commands/account/hello.ts b/commands/account/hello.ts new file mode 100644 index 000000000..e69de29bb diff --git a/commands/function/deploy.ts b/commands/function/deploy.ts index 11c2f1f92..f2afea049 100644 --- a/commands/function/deploy.ts +++ b/commands/function/deploy.ts @@ -61,7 +61,9 @@ exports.handle...
2
2
0
[{"id": "G0", "claim": "The new commands/account/hello.ts file appears to have been included accidentally and is not referred to anywhere else, so it should not be part of this pull request.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "DEFAULT_POL...
null
HubSpot__hubspot-cli__1365
HubSpot/hubspot-cli
1,365
defect
d70603e66d1698376f8ee3c2a818feac9dfdb7f9
1d33246f6c452281792a74f707569cf24af9fe24
Feature: Implement `hs account auth` command
## Description and Context In this PR, I'm implementing the `hs account auth` command. This command is meant to replace `hs init` and `hs auth` as part of our centralized configuration file EPIC. With this single command, the customer can both create a configuration file and later add accounts to it. ## Questions ...
diff --git a/bin/cli.js b/bin/cli.js index b7b33fd24..1c8393a3f 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -168,9 +168,18 @@ const isTargetedCommand = (options, commandMap) => { return checkCommand(options, commandMap); }; +const skipConfigAccountsSubCommands = { + target: false, + subCommands: { + auth: { ...
13
11
2
[{"id": "G0", "claim": "The cast of updatedConfig to CLIAccount_NEW (a workaround for the TypeScript error that accountId doesn't exist on CLIAccount_DEPRECATED) may not be the right solution — the author asks whether it is acceptable, and the maintainer suggests using the getAccountIdentifier util and/or switching the...
null
HubSpot__hubspot-cli__1377
HubSpot/hubspot-cli
1,377
defect
a251c54131e67a7c3ad01b76ea86d7b0ec4037a4
bfc1ead3ab8223df8a19be9ebc905cd48bc2a1e2
Unit tests for usage tracking and process utils
## Description and Context <!-- Provide a summary of what has changed --> <!-- Provide links to relevant discussions or documentation to promote understanding and addressing this PR --> <!-- Describe any packages you'd like to add and the reasons why. --> Adding some more unit test PR's. I'm trying to do this in sm...
diff --git a/lib/__tests__/process.test.ts b/lib/__tests__/process.test.ts new file mode 100644 index 000000000..934d6bbee --- /dev/null +++ b/lib/__tests__/process.test.ts @@ -0,0 +1,146 @@ +import readline from 'readline'; +import { logger, setLogLevel, LOG_LEVEL } from '@hubspot/local-dev-lib/logger'; +import { hand...
1
1
0
[{"id": "G0", "claim": "Instead of throwing a manual Error when the SIGHUP callback is not found, the test could just use expect(sighupCallback).toBeDefined().", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}]
null
HubSpot__hubspot-cli__1398
HubSpot/hubspot-cli
1,398
defect
dde5ee1d2fb72595e16bc79318048f14d7e17b70
227c0565f20297396f2629ecd4977370bdc4eb78
Feature: `hs config migrate` command
## Description and Context **UPDATED 3/21 WITH NEW SCREENSHOTS** Depends on changes in LDL ([PR](https://github.com/HubSpot/hubspot-local-dev-lib/pull/247)). I've created an experimental release of LDL to help with testing. This PR adds support for the `hs config migrate` command to help users migrate from the de...
diff --git a/bin/cli.js b/bin/cli.js index 509e1e328..2e593ef77 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -183,6 +183,7 @@ const skipConfigAccountsSubCommands = { const SKIP_CONFIG_VALIDATION = { init: { target: true }, auth: { target: true }, + config: { target: false, subCommands: { migrate: { target: true ...
8
8
2
[{"id": "G0", "claim": "The CLI should still validate the config before the `hs config migrate` command runs, rather than skipping validation for it.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "handleMigration and handleMerge should not call proc...
null
HubSpot__hubspot-cli__1401
HubSpot/hubspot-cli
1,401
defect
261ca4316db355e79867a2563a7b14bc755ce40a
009b75cc3181d300264c45cac69ed38b73299a3d
Porting top-level commands to TS (auth and filemanager)
## Description and Context <!-- Provide a summary of what has changed --> <!-- Provide links to relevant discussions or documentation to promote understanding and addressing this PR --> <!-- Describe any packages you'd like to add and the reasons why. --> Ports these files to TS: - auth - init - mv - list - re...
diff --git a/commands/__tests__/auth.test.ts b/commands/__tests__/auth.test.ts index f744c2b24..a32f4b103 100644 --- a/commands/__tests__/auth.test.ts +++ b/commands/__tests__/auth.test.ts @@ -1,12 +1,13 @@ -// @ts-nocheck -import yargs from 'yargs'; +import yargs, { Argv } from 'yargs'; import { addConfigOptions, add...
10
8
1
[{"id": "G0", "claim": "The `AuthArgs` type in commands/auth.ts should use the existing `AccountArgs` instead of redefining an inline `account?: string` property.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The non-null assertion on `provided...
null
HubSpot__hubspot-cli__1449
HubSpot/hubspot-cli
1,449
defect
394f4b9508cce97909fc0f199684e2cd51c001b7
b6b777d209d225c556b2fb7002c7f6cbffb7d565
Finishing the project commands TS port
## Description and Context <!-- Provide a summary of what has changed --> <!-- Provide links to relevant discussions or documentation to promote understanding and addressing this PR --> <!-- Describe any packages you'd like to add and the reasons why. --> This wraps up the work to port all of the project command fi...
diff --git a/commands/__tests__/project.test.ts b/commands/__tests__/project.test.ts index b740a2fec..c093f14aa 100644 --- a/commands/__tests__/project.test.ts +++ b/commands/__tests__/project.test.ts @@ -1,5 +1,4 @@ -// @ts-nocheck -import yargs from 'yargs'; +import yargs, { Argv } from 'yargs'; import deploy from '...
7
7
0
[{"id": "G0", "claim": "In commands/project/create.ts the new variable latestRepoReleaseTag could just be typed `string | undefined` instead of `string | null`, especially since the code converts it to undefined anyway on line 123.", "category": "design", "verdict": "supported", "priority": "P3", "scope": "introduced"}...
null
HubSpot__hubspot-cli__1514
HubSpot/hubspot-cli
1,514
defect
41dc2f1f58edf7b065911ea8b2b1813fde8400c8
d12f9306c547d3ad2cf037655c8222ebd1cb4489
Support auto updates (opt-in)
## Description and Context <!-- Provide a summary of what has changed --> <!-- Provide links to relevant discussions or documentation to promote understanding and addressing this PR --> <!-- Describe any packages you'd like to add and the reasons why. --> Depends on this LDL work: https://github.com/HubSpot/hubsp...
diff --git a/bin/cli.js b/bin/cli.js index 2125b0928..b8db5378e 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -15,9 +15,7 @@ const { validateAccountOptions, handleDeprecatedEnvVariables, } = require('../lib/middleware/configMiddleware'); -const { - notifyAboutUpdates, -} = require('../lib/middleware/notifications...
2
2
1
[{"id": "G0", "claim": "The enableOrDisableBooleanFieldPrompt helper in lib/configOptions.ts should perhaps live in the lib/prompts directory instead.", "category": "design", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The auto-update flow should also check that the npm pack...
null
HubSpot__hubspot-cli__1537
HubSpot/hubspot-cli
1,537
defect
dcdb6d99dda2b4d6040d883a2badbd2e58976e9d
63895ffff0c5380f786e583aecd644d380dc5d21
Support app secrets
## Description and Context <!-- Provide a summary of what has changed --> <!-- Provide links to relevant discussions or documentation to promote understanding and addressing this PR --> <!-- Describe any packages you'd like to add and the reasons why. --> Supporting app secrets. Adds simple CRUD functionality for...
diff --git a/commands/app.ts b/commands/app.ts index 02a21d43c..aed2931a3 100644 --- a/commands/app.ts +++ b/commands/app.ts @@ -1,14 +1,16 @@ import { Argv } from 'yargs'; +import migrateCommand from './app/migrate'; +import appSecretCommand from './app/secret'; import { makeYargsBuilder } from '../lib/yargsUtils'; ...
2
2
1
[{"id": "G0", "claim": "selectAppPrompt should not call process.exit itself; it should throw/return instead and let the handler catch, log and exit, which also makes the prompt easier to test.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "There may be t...
null
HubSpot__jinjava__1051
HubSpot/jinjava
1,051
defect
f80ca195bcfd84edd2020a2652ea7d79f2f4b490
1e3d8b8be953541ded6ead00232cfbd5c19d2b72
upgrade jackson
Upgrades to avoid CVE mentioned in https://github.com/HubSpot/jinjava/pull/1050
diff --git a/pom.xml b/pom.xml index ce8b483da..b0b123ee5 100644 --- a/pom.xml +++ b/pom.xml @@ -61,22 +61,22 @@ <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> - <version>2.12.6</version> + <version>2.14.0</version> <...
1
1
1
[{"id": "G0", "claim": "After the Jackson upgrade, the output-size-limiting logic in PyishObjectMapper.getAsPyishString (lines 69-74) may no longer work, so the author should make sure it still works.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
HubSpot__jinjava__1066
HubSpot/jinjava
1,066
defect
055f189d7ade28bc877f4ef52a927db64d362d59
390af1523059ee2c8a049da310a0db514f2a66e6
add feature flags to jinjava config
When building https://github.com/HubSpot/jinjava/pull/1065, I didn't like adding yet another property to the JinjavaConfig builder. I figured we could use a simple Feature Flags implementation. Partially inspired by https://ff4j.org/ and https://www.togglz.org/ . This can replace any boolean configs like enable...
diff --git a/src/main/java/com/hubspot/jinjava/JinjavaConfig.java b/src/main/java/com/hubspot/jinjava/JinjavaConfig.java index cb869e69a..cd9f8f9a9 100644 --- a/src/main/java/com/hubspot/jinjava/JinjavaConfig.java +++ b/src/main/java/com/hubspot/jinjava/JinjavaConfig.java @@ -23,6 +23,8 @@ import com.hubspot.jinjava.e...
1
1
0
[{"id": "G0", "claim": "DisabledFeatureActivationStrategy, StaticFeatureActivationStrategy and DelegatingFeatureActivationStrategy are redundant implementations that could be replaced with lambdas, so the DelegatingFeatureActivationStrategy boilerplate should be removed too.", "category": "design", "verdict": "supporte...
null
HubSpot__jinjava__1076
HubSpot/jinjava
1,076
defect
0c058a18cadbb60836d7c8e54effe48bd8936202
dc124670fb9c9bf9a7171389354082ae969f7c14
Make restricted methods and properties to be configurable in `JinjavaConfig`
In `JinjavaBeanELResolver`, restrict methods and properties based on the values from `JinjavaConfig` (`restrictedMethods`, `restrictedProperties` and `deferredExecutionRestrictedMethods`.
diff --git a/src/main/java/com/hubspot/jinjava/JinjavaConfig.java b/src/main/java/com/hubspot/jinjava/JinjavaConfig.java index cd9f8f9a9..1511b17af 100644 --- a/src/main/java/com/hubspot/jinjava/JinjavaConfig.java +++ b/src/main/java/com/hubspot/jinjava/JinjavaConfig.java @@ -43,6 +43,7 @@ import java.time.ZoneId; im...
6
6
2
[{"id": "G0", "claim": "Leave deferred-execution restricted methods as a static set instead of making them configurable, since there is no use-case for configuring them.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Checking whether each restricted set ...
null
HubSpot__jinjava__1112
HubSpot/jinjava
1,112
defect
b96402276cb01a68e8fb8f8f14bb0048bb0e21c5
29b9936d2cf434d5c9f67da63d8b280c31017201
Use a flag to prevent hashCode recursion in PyList or PyMap
Solves the same problem as https://github.com/HubSpot/jinjava/pull/1111. This demonstrates a different approach where a semaphore is used to ensure that a PyList or PyMap cannot have `hashCode()` called for itself during its own `hashCode()` call.
diff --git a/src/main/java/com/hubspot/jinjava/objects/collections/PyList.java b/src/main/java/com/hubspot/jinjava/objects/collections/PyList.java index 136ab8661..d49d5ad1b 100644 --- a/src/main/java/com/hubspot/jinjava/objects/collections/PyList.java +++ b/src/main/java/com/hubspot/jinjava/objects/collections/PyList....
1
1
0
[{"id": "G0", "claim": "The ThreadLocal<Semaphore> guarding hashCode is unnecessary overhead; a plain boolean would suffice, since these are non-concurrent collections whose other operations offer no locking guarantees.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
HubSpot__jinjava__1123
HubSpot/jinjava
1,123
defect
d912e54bd0db99a1021ecba79ec720192f46c29b
1a8d43a26aaffb75f7239b5c3e5f9e63bd2079ed
Prevent accidental expressions from being output
This adds a feature flag for `PREVENT_ACCIDENTAL_EXPRESSIONS` where, when combining output, it will check if the last character of the previous node and the first character of the current node create a tag/expression/note start string. If so, it will add a `\n{#- #}` spacer, which, if the entire output is passed back t...
diff --git a/src/main/java/com/hubspot/jinjava/tree/output/OutputList.java b/src/main/java/com/hubspot/jinjava/tree/output/OutputList.java index 738e9062c..5a5a39d14 100644 --- a/src/main/java/com/hubspot/jinjava/tree/output/OutputList.java +++ b/src/main/java/com/hubspot/jinjava/tree/output/OutputList.java @@ -3,11 +3...
2
2
0
[{"id": "G0", "claim": "The separator string built inside joinNodesWithoutAddingExpressions could be created statically rather than rebuilt on each call.", "category": "performance", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The repeated cur.charAt(0) checks could be extra...
null
HubSpot__jinjava__1128
HubSpot/jinjava
1,128
defect
f3b89125adbcc9c80a9730b2027298af38fbe39d
8fcd5efa61f76e1b7689ec86a492bc9521fdbb8b
Introduces a limited length render filter and HTML tag close filter
Currently, Jinjava provides filters for truncating HTML. The purpose of these is to shorten or summarize rich text. They correctly handle HTML so that tags are not left hanging open. However, they do not accommodate text that contains raw HubL as well as HTML. The purpose of this PR is to allow summaries of objects...
diff --git a/src/main/java/com/hubspot/jinjava/lib/filter/CloseHtmlFilter.java b/src/main/java/com/hubspot/jinjava/lib/filter/CloseHtmlFilter.java new file mode 100644 index 000000000..4f436145f --- /dev/null +++ b/src/main/java/com/hubspot/jinjava/lib/filter/CloseHtmlFilter.java @@ -0,0 +1,32 @@ +package com.hubspot.j...
1
1
1
[{"id": "G0", "claim": "CloseHtmlFilter's getName() returns \"render\" when it should return \"closehtml\".", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
HubSpot__jinjava__1140
HubSpot/jinjava
1,140
defect
0c47c7f14e6d02b378dc1c625319e6ed9adb090f
f5c36829613379b8f9ad1d4712e9687e8f5d7511
Make null values loop-able.
When the loop collection contains `null`, the loop var will be searching the outer scope of the value instead of just use the `null` value. For example, ``` context.put("number", -1); context.put("the_list", Lists.newArrayList(1L, 2L, null, null, null)); String template = "{% for number in the_list %} {{ number }...
diff --git a/src/main/java/com/hubspot/jinjava/interpret/NullValue.java b/src/main/java/com/hubspot/jinjava/interpret/NullValue.java new file mode 100644 index 000000000..ed3d7f0d3 --- /dev/null +++ b/src/main/java/com/hubspot/jinjava/interpret/NullValue.java @@ -0,0 +1,21 @@ +package com.hubspot.jinjava.interpret; + +...
2
1
1
[{"id": "G0", "claim": "Making null values loop-able should not be applied by default; the behaviour should be opt-in behind a flag residing in LegacyOverrides (e.g. withNullableLoopValues()), since users may be relying on the existing 'default' functionality.", "category": "design", "verdict": "supported", "priority":...
null
HubSpot__jinjava__1150
HubSpot/jinjava
1,150
defect
87e033660322c5f93a45a3b657a9717b2d35ddf2
51b9f6f3588c77a430e833840441084093e2c458
Debug Undefined Feature to echo back Uknown tokens.
Inspired by this [PR - Render back unresolved tokens](https://github.com/HubSpot/jinjava/pull/1072). Implemented instead with features as suggested by @jasmith-hs and named `ECHO_UNDEFINED` . I originally wanted to call it DEBUG_UNDEFINED to get close to this [feature in jinja2](https://github.com/pallets/jinja/blob/3f...
diff --git a/src/main/java/com/hubspot/jinjava/lib/expression/DefaultExpressionStrategy.java b/src/main/java/com/hubspot/jinjava/lib/expression/DefaultExpressionStrategy.java index 9bb27fed8..879431ee8 100644 --- a/src/main/java/com/hubspot/jinjava/lib/expression/DefaultExpressionStrategy.java +++ b/src/main/java/com/h...
2
2
1
[{"id": "G0", "claim": "The echo check keys off `result.isEmpty()` after string conversion, so a defined expression that renders an empty string like `{{ '' }}` would echo the raw token instead of outputting an empty string; the check should be moved earlier and use `var == null` so only undefined tokens are echoed bac...
null
HubSpot__jinjava__1152
HubSpot/jinjava
1,152
defect
6003ef04bc43c0911ae9b3e2d95fb5c48c3b13fc
2335c05c05f669d00be9b7f557ebac25b501f76a
add support for numeric keys in map literal
This supercedes #934 (rebased, and then addresses the review comment), and fixes #1090. Note that I verified Python Jinja accepts numbers as dict keys: ```python >>> from jinja2 import Environment >>> env = Environment() >>> expr = env.compile_expression("{0:'test'}[0]") >>> expr() 'test' ```
diff --git a/src/main/java/com/hubspot/jinjava/el/ext/AstDict.java b/src/main/java/com/hubspot/jinjava/el/ext/AstDict.java index 938449834..a2181659c 100644 --- a/src/main/java/com/hubspot/jinjava/el/ext/AstDict.java +++ b/src/main/java/com/hubspot/jinjava/el/ext/AstDict.java @@ -7,6 +7,7 @@ import de.odysseus.el.tree...
1
1
1
[{"id": "G0", "claim": "The numeric-key branch should use Objects.toString() instead of calling .toString() on the evaluated key so it is null-safe.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
HubSpot__jinjava__1168
HubSpot/jinjava
1,168
defect
bdbb829a6252143d56c5b8d12b04863b6c300da2
21dcf9fa0acdc86310420cd2709b4be3021d37d0
Intercept out of range ArrayIndexOutOfBoundsException with custom's one
The goal is to intercept runtime exception `ArrayIndexOutOfBoundsException` with jinjava's `IndexOutOfRangeException` so we can notify user with predicted root cause which would be our custom exception.
diff --git a/src/main/java/com/hubspot/jinjava/objects/collections/PyList.java b/src/main/java/com/hubspot/jinjava/objects/collections/PyList.java index 30a99f8d9..5658f6a0d 100644 --- a/src/main/java/com/hubspot/jinjava/objects/collections/PyList.java +++ b/src/main/java/com/hubspot/jinjava/objects/collections/PyList....
1
1
1
[{"id": "G0", "claim": "It would be good for the outOfRange test to also verify that the out-of-range access throws the exception (checking the error/exception available from the render result or the context) rather than only asserting a null value.", "category": "testing", "verdict": "supported", "priority": "P1", "sc...
null
HubSpot__jinjava__1173
HubSpot/jinjava
1,173
defect
61452e4557666d4b405c1b7f9f4b1e0133e24427
e5a827ad09906eb213ca6256f708c5fc16ad6492
find first valid deferred words
We end up with a lot blank deferred words when they are attributes of array values. For example, `{{ deferred.results[0].attribute }}` will return the used tokens `deferred` and `.attribute`. `.attribute` is treated a value of `attribute` with a base of (blank) because it splits on periods. This cleans up the gene...
diff --git a/src/main/java/com/hubspot/jinjava/lib/tag/eager/DeferredToken.java b/src/main/java/com/hubspot/jinjava/lib/tag/eager/DeferredToken.java index 963f1e346..1abf83c6f 100644 --- a/src/main/java/com/hubspot/jinjava/lib/tag/eager/DeferredToken.java +++ b/src/main/java/com/hubspot/jinjava/lib/tag/eager/DeferredTo...
1
1
1
[{"id": "G0", "claim": "Taking the part after a '.' with a limit-2 split is wrong for tokens like '.bar.foobar': getFirstNonEmptyToken then returns 'bar.foobar' where the first valid word should be 'bar', so the token needs to be split further.", "category": "correctness", "verdict": "supported", "priority": "P1", "sco...
null
HubSpot__jinjava__1174
HubSpot/jinjava
1,174
defect
61452e4557666d4b405c1b7f9f4b1e0133e24427
468009609f2bcaca0b3ea7e058ccf92dff189c49
Add a feature to output template error when the variable is undefined
This PR adds a feature `OUTPUT_UNDEFINED_VARIABLES_ERROR`. When enabled, a template error (severity=WARNING) will be added when trying to resolve an undefined variable.
diff --git a/src/main/java/com/hubspot/jinjava/interpret/JinjavaInterpreter.java b/src/main/java/com/hubspot/jinjava/interpret/JinjavaInterpreter.java index 8e0510aca..5ff87fa7c 100644 --- a/src/main/java/com/hubspot/jinjava/interpret/JinjavaInterpreter.java +++ b/src/main/java/com/hubspot/jinjava/interpret/JinjavaInte...
1
1
1
[{"id": "G0", "claim": "The undefined-variable error check should test the feature's activation strategy against the local `context` rather than `getContext()`.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
HubSpot__jinjava__1248
HubSpot/jinjava
1,248
defect
6bcb7cb55de837c1af093a763b6e6e5879d53b01
12abbb92899f2fc570eb94ab4792e25a422124f1
Fix HubL `from` tag nested relative import resolution
This PR fixes a bug with relative imports using the `from` tag. This issue surfaced when investigating a customer issue with HubL + React themes where they had a theme structure similar to this one: ``` /test-theme/theme/ ├── hubl-modules/navigation.module/module.hubl.html (1) └── partials/atoms/ ...
diff --git a/src/main/java/com/hubspot/jinjava/lib/tag/FromTag.java b/src/main/java/com/hubspot/jinjava/lib/tag/FromTag.java index 8bbb4df65..8b907d7f4 100644 --- a/src/main/java/com/hubspot/jinjava/lib/tag/FromTag.java +++ b/src/main/java/com/hubspot/jinjava/lib/tag/FromTag.java @@ -85,6 +85,11 @@ public String interp...
2
2
0
[{"id": "G0", "claim": "The test setup in FromTagTest is verbose with duplicate boilerplate and should either follow a testing pattern already in use or be made reusable.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "FromTag could use ImportTag...
null
HubSpot__jinjava__1274
HubSpot/jinjava
1,274
defect
0b610c9644f8d5cba9076a829ef43c40348c9217
5877a0539396f78bb6da24c7170dd4dc5df20a91
Chained filters optimization
## Summary This PR introduces an optimization for chained filter expressions in Jinjava templates. Instead of creating deeply nested AST nodes for expressions like `{{ foo|filter1|filter2|filter3 }}`, a flattened `AstFilterChain` node is used, which improves performance by reducing recursive call overhead. K...
diff --git a/src/main/java/com/hubspot/jinjava/JinjavaConfig.java b/src/main/java/com/hubspot/jinjava/JinjavaConfig.java index 3cff4787c..343df63a8 100644 --- a/src/main/java/com/hubspot/jinjava/JinjavaConfig.java +++ b/src/main/java/com/hubspot/jinjava/JinjavaConfig.java @@ -88,6 +88,7 @@ public class JinjavaConfig { ...
4
4
1
[{"id": "G0", "claim": "All the tests should be verified to pass with enableFilterChainOptimization set to true.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new AstFilterChain evaluation path should be tested for parity with regular filter parsin...
null
HubSpot__jinjava__1284
HubSpot/jinjava
1,284
defect
5db2a8603bc9e5e4f6503263fed17bf8c36b6382
60bafcef853fe7466101454ae42e9c5b4e820531
Handle unknown and disabled filters inline in AstFilterChain
Fall back to un-optimized filter chain for unknown filters #...
diff --git a/src/main/java/com/hubspot/jinjava/el/ext/AstFilterChain.java b/src/main/java/com/hubspot/jinjava/el/ext/AstFilterChain.java index 30dfc4435..34cae1689 100644 --- a/src/main/java/com/hubspot/jinjava/el/ext/AstFilterChain.java +++ b/src/main/java/com/hubspot/jinjava/el/ext/AstFilterChain.java @@ -88,6 +88,18...
1
1
1
[{"id": "G0", "claim": "The unknown/disabled filter handling in AstFilterChain.eval is more complicated than it needs to be and does not handle disabled filters the same as the non-chained logic; both cases should simply set value to null and continue the chain instead of building the custom error.", "category": "corre...
null
HubSpot__jinjava__1310
HubSpot/jinjava
1,310
defect
a6c5d0bddc49c37307f3e2071ef3011b654bf816
92a0739e357da01e524f4cafeabeaf9656d623d5
Fix NPE when calling macros inside ternary with variable condition
Using a macro in a ternary would lead to the macro name failing to parse correctly and throw an NPE. For ternary like: ``` {{ greet('world') if myVar else greet('nobody') }} ``` The `else` keyword in a ternary is registered with `Symbol.COLON`, causing `nonliteral()` to greedily interpret `myVar else greet('...
diff --git a/src/main/java/com/hubspot/jinjava/el/ext/ExtendedParser.java b/src/main/java/com/hubspot/jinjava/el/ext/ExtendedParser.java index 54726af70..6bf8132fb 100644 --- a/src/main/java/com/hubspot/jinjava/el/ext/ExtendedParser.java +++ b/src/main/java/com/hubspot/jinjava/el/ext/ExtendedParser.java @@ -281,7 +281,...
1
1
1
[{"id": "G0", "claim": "Add an adjacent test for calling a macro in a standard ternary using `?` and `:` to ensure that syntax also parses properly.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
HubSpot__jinjava__262
HubSpot/jinjava
262
defect
fa2cb672afe9a59254b96ecb61c2deca89258bdc
5394a396985f3c5b0dbd6c9934ad3f206d9009dc
Add common set theory filters.
Fixes https://github.com/HubSpot/jinjava/issues/261 Adds `union`, `intersect`, `difference`, and `symmetric_difference` similar to Ansible https://ansible-docs.readthedocs.io/zh/stable-2.0/rst/playbooks_filters.html#set-theory-filters.
diff --git a/src/main/java/com/hubspot/jinjava/lib/filter/DifferenceFilter.java b/src/main/java/com/hubspot/jinjava/lib/filter/DifferenceFilter.java new file mode 100644 index 000000000..bf6b16af1 --- /dev/null +++ b/src/main/java/com/hubspot/jinjava/lib/filter/DifferenceFilter.java @@ -0,0 +1,59 @@ +package com.hubspo...
4
4
0
[{"id": "G0", "claim": "DifferenceFilter should use Guava's Sets.difference instead of the hand-rolled loop to compute elements in the first list but not the second.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "UnionFilter should use Guava's Sets.union...
null
HubSpot__jinjava__264
HubSpot/jinjava
264
defect
fa2cb672afe9a59254b96ecb61c2deca89258bdc
e8207a0646d2bcfe73501e666a5c9c149f14c890
Add validation mode
Currently jinjava only parses expressions inside active code paths. This is efficient, but also does not look at expressions that might have syntax errors. This PR adds a validation mode to the interpreter that parses inactive code blocks for syntax, but does not set any variables nor actually execute any macros, f...
diff --git a/src/main/java/com/hubspot/jinjava/JinjavaConfig.java b/src/main/java/com/hubspot/jinjava/JinjavaConfig.java index 1db4686b2..a672bdafe 100644 --- a/src/main/java/com/hubspot/jinjava/JinjavaConfig.java +++ b/src/main/java/com/hubspot/jinjava/JinjavaConfig.java @@ -63,8 +63,7 @@ private JinjavaConfig(Charset...
4
2
2
[{"id": "G0", "claim": "A later expression may become invalid because validation mode does not evaluate macro or set tags.", "category": "correctness", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The removed IfTag checking (findNextIfElseTagNode/evaluateIfElseTagNode) may be h...
null
HubSpot__jinjava__308
HubSpot/jinjava
308
defect
a1d2ee0d04ed0109c67cc0040a6c59bd39635fe3
4e0b303ceacf9e594f49244b3fbfe6c3757d8ec7
Allow ability to set a max recursion depth in config.
This is a middle ground option for https://github.com/HubSpot/jinjava/issues/91. You can now set `enableRecursiveMacroCalls` to `true` and `maxMacroRecursionDepth` to a reasonable value to prevent a template from killing your thread due to stack overflows.
diff --git a/src/main/java/com/hubspot/jinjava/JinjavaConfig.java b/src/main/java/com/hubspot/jinjava/JinjavaConfig.java index 3dccd85d0..2e82f5ba4 100644 --- a/src/main/java/com/hubspot/jinjava/JinjavaConfig.java +++ b/src/main/java/com/hubspot/jinjava/JinjavaConfig.java @@ -41,6 +41,7 @@ public class JinjavaConfig { ...
3
2
0
[{"id": "G0", "claim": "The if/else that builds the cycle-or-max-depth error message in AstMacroFunction should be written as a ternary statement instead.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "It might be time to use a builder in Jinjav...
null
HubSpot__jinjava__327
HubSpot/jinjava
327
defect
5cf9f7708db9d5289d239cc3befc215a5188042b
c19a73b6831866c48e2fdaacf3222903863e3215
defer variables containing deferred vals & track deferred nodes in context
Following https://github.com/HubSpot/jinjava/pull/282 1. **Make deferred infectious for variables** It's possible that variables contain deferred values, in that case the assigned variable(s) should be deferred too, since expressions depending on variables containing deferred values can't and shouldn't be evaluated...
diff --git a/src/main/java/com/hubspot/jinjava/interpret/Context.java b/src/main/java/com/hubspot/jinjava/interpret/Context.java index f3d291420..ca16f0980 100644 --- a/src/main/java/com/hubspot/jinjava/interpret/Context.java +++ b/src/main/java/com/hubspot/jinjava/interpret/Context.java @@ -28,6 +28,7 @@ import java....
1
1
1
[{"id": "G0", "claim": "The newly added deferredNodes collection must also be cleared when the context is cleared/reset, otherwise deferred nodes accumulate across passes.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
HubSpot__jinjava__331
HubSpot/jinjava
331
defect
c3c310af48bbb980ac1f1f5c3c78ba0dd34654be
82f2ad997d789465be282f880f8a38e3f162a310
Support empty bracket implicit index syntax.
It was not possible previously do something like `list[3:]` to get the sublist of all elements from index 3 to the end, as well as `list[:3]`, the sublist of all elements from index 0 up to index 3.
diff --git a/src/main/java/com/hubspot/jinjava/el/ext/AstRangeBracket.java b/src/main/java/com/hubspot/jinjava/el/ext/AstRangeBracket.java index 3b36e8ec4..45b84bdf1 100644 --- a/src/main/java/com/hubspot/jinjava/el/ext/AstRangeBracket.java +++ b/src/main/java/com/hubspot/jinjava/el/ext/AstRangeBracket.java @@ -41,7 +4...
1
1
0
[{"id": "G0", "claim": "The if/else block assigning baseItr could be written as a ternary.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}]
null
HubSpot__jinjava__410
HubSpot/jinjava
410
defect
06ce543c657343a59f06a5345a4bf0330daf17ce
96ec8ef273ed63c800194a845116ea8cd4744760
adds support for Custom Token Scanner Symbols
This pull request aims at implementing the Custom Token Symbols class for Jinjava. The goal is to allow the user to specify the tokens that he/she wants to use. It can be extending using the TokenScannerSymbols abstract class and then filling the abstract methods. A few lines inside the tree package have been change...
diff --git a/src/main/java/com/hubspot/jinjava/Jinjava.java b/src/main/java/com/hubspot/jinjava/Jinjava.java index a76b1a6a2..e9abd46d3 100644 --- a/src/main/java/com/hubspot/jinjava/Jinjava.java +++ b/src/main/java/com/hubspot/jinjava/Jinjava.java @@ -171,7 +171,10 @@ public String render(String template, Map<String, ...
16
15
4
[{"id": "G0", "claim": "ExpressionNode's nested-interpretation check should use the scanner symbols instead of the hard-coded \"{{\" and \"{%\" literals.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The unclosed-comment check in TreeParser should ...
null
HubSpot__jinjava__445
HubSpot/jinjava
445
defect
06ce543c657343a59f06a5345a4bf0330daf17ce
da3f60ee62e87269be84591e03318ad35895d7e5
TagCycleException was thrown when rendering template that doesn't have any cycles
Before these changes templates as I have created couldn't be rendered without errors. Jinjava had mistakenly thrown TagCycleException in such cases. Adding "false" as a parameter to render() method will reduce harm from that bug to zero.
diff --git a/src/main/java/com/hubspot/jinjava/lib/tag/IncludeTag.java b/src/main/java/com/hubspot/jinjava/lib/tag/IncludeTag.java index 5c4a7887e..d8b985c98 100644 --- a/src/main/java/com/hubspot/jinjava/lib/tag/IncludeTag.java +++ b/src/main/java/com/hubspot/jinjava/lib/tag/IncludeTag.java @@ -106,7 +106,7 @@ public ...
6
4
1
[{"id": "G0", "claim": "The author should investigate why a template without any cycle throws a TagCycleException, and check whether disabling processExtendRoots has adverse effects on the extends functionality.", "category": "design", "verdict": "uncertain", "priority": "P1", "scope": "introduced"}, {"id": "G1", "clai...
null
HubSpot__jinjava__493
HubSpot/jinjava
493
defect
7bf4586e7e7c5dc472de320f4c30ec8b6bbd11f7
f3dfac157d70e133d4db6596c7a1a2da28cae1f5
Issue 491: Support IN operator for dictionaries
Check if the dictionary contains the required **key**.
diff --git a/src/main/java/com/hubspot/jinjava/el/ext/CollectionMembershipOperator.java b/src/main/java/com/hubspot/jinjava/el/ext/CollectionMembershipOperator.java index c55df17f2..3e4ce763a 100644 --- a/src/main/java/com/hubspot/jinjava/el/ext/CollectionMembershipOperator.java +++ b/src/main/java/com/hubspot/jinjava/...
1
1
1
[{"id": "G0", "claim": "Tests should be added for the new CollectionMembershipOperator map-handling change, even though the class previously had no tests.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
HubSpot__jinjava__507
HubSpot/jinjava
507
defect
7bf4586e7e7c5dc472de320f4c30ec8b6bbd11f7
b2d01989210369d41539d1013a71865aa17cfde2
Issue 492: For loop to iterate over keys of dictionary
Make possible to configure iteration mode for dictionaries
diff --git a/src/main/java/com/hubspot/jinjava/JinjavaConfig.java b/src/main/java/com/hubspot/jinjava/JinjavaConfig.java index 99a4d66d8..d6932405c 100644 --- a/src/main/java/com/hubspot/jinjava/JinjavaConfig.java +++ b/src/main/java/com/hubspot/jinjava/JinjavaConfig.java @@ -55,6 +55,7 @@ public class JinjavaConfig { ...
1
1
1
[{"id": "G0", "claim": "Instead of threading the iterateOverMapKeys flag down through all the getLoop overloads and call sites, the code should get a hold of the interpreter and its config via the static JinjavaInterpreter.getCurrent().", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introdu...
null
HubSpot__jinjava__525
HubSpot/jinjava
525
defect
022074e9edf3418f3b4025bd8bc2caccf0bfa104
3d50717be34f8879ad0ad78c7fbc65d015d6855f
Add ChunkResolver to partially resolve expressions
Part of https://github.com/HubSpot/jinjava/issues/532 --- This PR introduces what I have called the `ChunkResolver` as a part of my Eager Execution project ([draft PR for context](https://github.com/HubSpot/jinjava/pull/519)). ## Purpose The purpose of the ChunkResolver is to evaluate as much of an expression as po...
diff --git a/src/main/java/com/hubspot/jinjava/interpret/Context.java b/src/main/java/com/hubspot/jinjava/interpret/Context.java index 0afa5d4fb..4cef6b493 100644 --- a/src/main/java/com/hubspot/jinjava/interpret/Context.java +++ b/src/main/java/com/hubspot/jinjava/interpret/Context.java @@ -93,6 +93,7 @@ public enum L...
4
3
0
[{"id": "G0", "claim": "The RESERVED_KEYWORDS set should reference constants from the tags themselves rather than hardcoding the keyword names.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The non-obvious chain of replaceAll regex calls in get...
null
HubSpot__jinjava__529
HubSpot/jinjava
529
defect
d05988ee52519286329c223ba71bebe76984383a
1fa94fb402127c06890eaab3dbb82898aa49c178
Introduce Eager Tokens
Part of https://github.com/HubSpot/jinjava/issues/532 --- For the Eager Execution project (see https://github.com/HubSpot/jinjava/pull/519), the variables, functions, and filters (together referred to as "words") need to be marked so it is known which words need to be resolved/evaluated for a second rendering pass. T...
diff --git a/src/main/java/com/hubspot/jinjava/JinjavaConfig.java b/src/main/java/com/hubspot/jinjava/JinjavaConfig.java index 334ec8009..d434f6dca 100644 --- a/src/main/java/com/hubspot/jinjava/JinjavaConfig.java +++ b/src/main/java/com/hubspot/jinjava/JinjavaConfig.java @@ -57,6 +57,7 @@ public class JinjavaConfig { ...
3
1
1
[{"id": "G0", "claim": "A test for the eager-token deferred-word marking in DeferredValueUtils would be good.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Instead of fixed behaviour such as eager or deferred, the interpreter could introduce a render \...
null
HubSpot__jinjava__530
HubSpot/jinjava
530
defect
d05988ee52519286329c223ba71bebe76984383a
b150419269893d6419cd527d9f8ef75422cd477b
add size limited pymaps and pylists
User-provided templates should not be allowed to use unlimited resources. This is a failsafe that adds a limit the maximum size of lists and maps. The default is no (practical) limit. This is similar to https://github.com/HubSpot/jinjava/pull/137
diff --git a/src/main/java/com/hubspot/jinjava/JinjavaConfig.java b/src/main/java/com/hubspot/jinjava/JinjavaConfig.java index 334ec8009..9b780a2c9 100644 --- a/src/main/java/com/hubspot/jinjava/JinjavaConfig.java +++ b/src/main/java/com/hubspot/jinjava/JinjavaConfig.java @@ -46,15 +46,17 @@ public class JinjavaConfig ...
5
2
0
[{"id": "G0", "claim": "Truncate the collection to keep it under the limit and add a warning instead of throwing, so continually growing data degrades templates gracefully rather than breaking them.", "category": "design", "verdict": "opposed", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The addAll...
null
HubSpot__jinjava__531
HubSpot/jinjava
531
defect
8de83d1a0e5e767f7a8d35d7773dac231135b058
e5b850bf91634ad6eda9ae9f4b53b9c4069d57ce
Filter upgrades to support kw params
This change includes the following: - Upgrades to filters with >1 params that have 100% code coverage - There are some fixes to Jinjavadoc as they didn't match unit tests @boulter This is following up on the `AbstractFilter` #523 , these are draft changes so let me know what you think of these changes and whethe...
diff --git a/src/main/java/com/hubspot/jinjava/lib/filter/AbstractFilter.java b/src/main/java/com/hubspot/jinjava/lib/filter/AbstractFilter.java index 3bbc2fd1f..ee9dd67a9 100644 --- a/src/main/java/com/hubspot/jinjava/lib/filter/AbstractFilter.java +++ b/src/main/java/com/hubspot/jinjava/lib/filter/AbstractFilter.java...
3
2
2
[{"id": "G0", "claim": "The filter only falls back to the no-arg Functions.dateTimeFormat when format, timezone and locale are all null, so a call that sets some params passes nulls for the rest into Functions.dateTimeFormat, which (as the author confirms) errors out on a null timezone — must all of these be null?", "c...
null
HubSpot__jinjava__557
HubSpot/jinjava
557
defect
856c532eeea333bcdae3a29fa01abe08b0c13e8e
522a0af059234b01655f0d05b6415130d0c8d746
Implement EagerSetTag
Part of https://github.com/HubSpot/jinjava/issues/532 --- This PR first extracts some functionality from the SetTag into static methods to be reusable by the EagerSetTag. There are a few main use cases for interpreting a set tag while in `EagerExecutionMode`: 1. It's a normal set tag that doesn't work with or a...
diff --git a/src/main/java/com/hubspot/jinjava/interpret/Context.java b/src/main/java/com/hubspot/jinjava/interpret/Context.java index c6955b6bc..0d41d108b 100644 --- a/src/main/java/com/hubspot/jinjava/interpret/Context.java +++ b/src/main/java/com/hubspot/jinjava/interpret/Context.java @@ -50,6 +50,7 @@ public class...
2
1
0
[{"id": "G0", "claim": "The eager set tag could be implemented by manipulating the parsed tree directly over multiple passes, as compilers do, instead of returning a reconstructed string as its output.", "category": "design", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "`isProt...
null
HubSpot__jinjava__558
HubSpot/jinjava
558
defect
522a0af059234b01655f0d05b6415130d0c8d746
112f280880ac2c81bd78a422fc0f206e83a7d3a0
Implement EagerPrintTag and EagerDoTag
Part of https://github.com/HubSpot/jinjava/issues/532 --- Since the print tag and do tag are nearly identical (print tags include the expression output, while do tags omit the output), both of their eager implementations are included in this PR. Print and Do tags are also similar to Set tags, but they are essent...
diff --git a/src/main/java/com/hubspot/jinjava/lib/tag/eager/EagerDoTag.java b/src/main/java/com/hubspot/jinjava/lib/tag/eager/EagerDoTag.java new file mode 100644 index 000000000..98ad4dc14 --- /dev/null +++ b/src/main/java/com/hubspot/jinjava/lib/tag/eager/EagerDoTag.java @@ -0,0 +1,74 @@ +package com.hubspot.jinjava...
3
3
1
[{"id": "G0", "claim": "For short inputs, the test's template and expected output should be written inline in the test code rather than in separate jinja resource files.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The error message thrown whe...
null
HubSpot__jinjava__604
HubSpot/jinjava
604
defect
f5fa978cff15324f2a8be24d832ab680f11b00c6
6cc9f8dd2185efbbb16917fecc5d0872400b22ce
[Eager Execution] Don't remove the import resource path from the context in EagerImportTag
The `Context. IMPORT_RESOURCE_PATH_KEY` is used when doing relative path resolving within macro functions imported from other files so we don't want to remove it from the imported context. The simple case is fixing this for Eager Execution where the macro is evaluated during the first pass. I just had to remove the ...
diff --git a/src/main/java/com/hubspot/jinjava/lib/fn/eager/EagerMacroFunction.java b/src/main/java/com/hubspot/jinjava/lib/fn/eager/EagerMacroFunction.java index 7bad483c7..86782e0ba 100644 --- a/src/main/java/com/hubspot/jinjava/lib/fn/eager/EagerMacroFunction.java +++ b/src/main/java/com/hubspot/jinjava/lib/fn/eager...
2
1
1
[{"id": "G0", "claim": "A macro function imported without an alias may not get its import resource pathing handled, and the author still needs to explore that case.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Storing the macro's importResourcePat...
null
HubSpot__jinjava__610
HubSpot/jinjava
610
defect
5bb8c6d7f3c295bc16dea888c75795cc1c2a17fe
e9012a4c6fa9dee47f36b4dc4fac11d3304c448b
[Eager Execution] Support legacy dictionary creation
Since Jinjava doesn't support variables names in dictionaries, we shouldn't support it in Eager Execution. At the same time, it doesn't seem entirely right to make changes to this repo which aims to mirror Jinja that make it more different from Jinja without providing an alternative. @boulter I have this idea to ...
diff --git a/src/main/java/com/hubspot/jinjava/JinjavaConfig.java b/src/main/java/com/hubspot/jinjava/JinjavaConfig.java index 67e4c6bbb..62cf18ba7 100644 --- a/src/main/java/com/hubspot/jinjava/JinjavaConfig.java +++ b/src/main/java/com/hubspot/jinjava/JinjavaConfig.java @@ -62,6 +62,7 @@ public class JinjavaConfig { ...
1
1
1
[{"id": "G0", "claim": "The new generic \"legacy\" config flag should be made more specific to the individual legacy behaviors, since someone may want some of the legacy functionality while their code breaks with others.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
HubSpot__jinjava__612
HubSpot/jinjava
612
defect
25d787cd8cf70fdcddf0ab7f885a6f22ddb1ba84
d236847745c624474fcc15bd25bdf49c6fa7193a
[Eager Execution] Treat non-standard number representations as strings
A phone number such as `+12223334444` would resolve as `12223334444` before this PR. This happened because when we converted that into a pyish object, we didn't surround it with quotes because it was interpretable as a double. This PR makes it so that we write it a plus sign-prefixed string is written as a string, r...
diff --git a/src/main/java/com/hubspot/jinjava/objects/serialization/PyishSerializer.java b/src/main/java/com/hubspot/jinjava/objects/serialization/PyishSerializer.java index faeecd306..3d0e0aadc 100644 --- a/src/main/java/com/hubspot/jinjava/objects/serialization/PyishSerializer.java +++ b/src/main/java/com/hubspot/ji...
1
1
0
[{"id": "G0", "claim": "The ad-hoc character special-casing of non-standard number representations in PyishSerializer is awkward and should be replaced with a whitelisting approach using a regular expression instead of listing each token to handle specially.", "category": "design", "verdict": "supported", "priority": "...
null
HubSpot__jinjava__658
HubSpot/jinjava
658
defect
8fcfe6071bba48cb5eaa99b1937f3a39afc284dc
27cf68cf0f09c8309ad2446ea2d86f7f77c3b13a
add rangeLimit to JinjavaConfig (1000 by default)
Changes: - we need a JinjavaInterpreter instance to execute range function because we now retrieve the rangeLimit from the configuration instead of an hardcoded value - default range limit is still 1000 to avoid any breaking change - add 2 units test and update an existing one - mvn prettier:write ok
diff --git a/src/main/java/com/hubspot/jinjava/JinjavaConfig.java b/src/main/java/com/hubspot/jinjava/JinjavaConfig.java index d62880df8..235bc1d93 100644 --- a/src/main/java/com/hubspot/jinjava/JinjavaConfig.java +++ b/src/main/java/com/hubspot/jinjava/JinjavaConfig.java @@ -15,6 +15,8 @@ ***************************...
3
3
0
[{"id": "G0", "claim": "The static import of JinjavaInterpreter.getCurrent should be dropped because it is used only once.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The range documentation should go back to \" values.\" because configurabil...
null
HubSpot__jinjava__698
HubSpot/jinjava
698
defect
512286e55b022410d4575bba157ad5a1e28a6caa
30d460d2c2e98bc1080d2dceb8c90becf4364a79
Support Assignment Blocks with Set tags
For https://github.com/HubSpot/jinjava/issues/693 and https://github.com/HubSpot/jinjava/issues/422 Jinja 2.8 adds support for block set assignments (https://jinja.palletsprojects.com/en/3.0.x/templates/#block-assignments) Add support for set tags with the notation: ``` {% set foo %} A value of {{ 1 + 1 }} {% e...
diff --git a/src/main/java/com/hubspot/jinjava/lib/tag/FlexibleTag.java b/src/main/java/com/hubspot/jinjava/lib/tag/FlexibleTag.java new file mode 100644 index 000000000..2bf54990f --- /dev/null +++ b/src/main/java/com/hubspot/jinjava/lib/tag/FlexibleTag.java @@ -0,0 +1,7 @@ +package com.hubspot.jinjava.lib.tag; + +imp...
2
2
1
[{"id": "G0", "claim": "The set-tag code snippets (e.g. the TextMate snippet) should probably be adjusted now that the tag supports block set syntax.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Why is executeSet executed twice in interpretBlock...
null
HubSpot__jinjava__895
HubSpot/jinjava
895
defect
ca87af4a3e6d8e4cf6f1a404ac9738e3d9abf7ca
e94db3607b361c122977c0edfa8c78f63fd6d9a5
Bind custom operators between `mul` and `unary`
Closes #893 Currently, our custom operators like `|` and `is` bind tighter than unary operators. This means `-1 is integer` incorrectly evaluates like `-(1 is integer)`, leading to an error when Jinjava tries to make `true` negative. This is because these operators are defined within `value` which is called by `una...
diff --git a/src/main/java/com/hubspot/jinjava/el/ext/ExtendedParser.java b/src/main/java/com/hubspot/jinjava/el/ext/ExtendedParser.java index 00fdcab5c..bca56d0ea 100644 --- a/src/main/java/com/hubspot/jinjava/el/ext/ExtendedParser.java +++ b/src/main/java/com/hubspot/jinjava/el/ext/ExtendedParser.java @@ -427,53 +427...
2
2
1
[{"id": "G0", "claim": "The new test methods should be named with the 'it' prefix, e.g. itBindsUnaryMinusTighterThanCmp instead of unaryMinusBindsTighterThanCmp.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Filter operations (|, is, is not) sh...
null
HubSpot__jinjava__903
HubSpot/jinjava
903
defect
672374ec43d336a6568478d202fc4deb5ce9646b
f5c3d5b47292dcca8e95479a7f1be649309c2753
Reintroduce whitespace control parsing fix with legacy override
Closes #892 Depends on #902 This PR is basically #896 but with the changes disabled by default. They can be enabled by setting a new flag on `LegacyOverrides` as part of the `JinjavaConfig`.
diff --git a/src/main/java/com/hubspot/jinjava/LegacyOverrides.java b/src/main/java/com/hubspot/jinjava/LegacyOverrides.java index f79060bda..9fb46b03d 100644 --- a/src/main/java/com/hubspot/jinjava/LegacyOverrides.java +++ b/src/main/java/com/hubspot/jinjava/LegacyOverrides.java @@ -10,12 +10,16 @@ public class Legacy...
2
2
0
[{"id": "G0", "claim": "Apply the same suggestion as in jinjava#902 discussion r932519485 to the interpreter/config lookup in handleTrim, if the author likes that idea.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Use unwrapped.charAt(0) == '-...
null
HubSpot__jinjava__910
HubSpot/jinjava
910
defect
c9e80e5f834aad2582590a114a444944992f5dfe
ac2a06368ede25e56bbbbcf6752224c3c6c50ed2
Upgrade jackson and serailize with single quote char
Speed up serialization by not needing to do a regex replace on double quotes. Instead in jackson 2.10, they introduced the ability to specify the quote character. If we set the quote character to be a single quote rather than a double quote, then we don't have to use regex to replace the double quotes later.
diff --git a/pom.xml b/pom.xml index 67e11dfed..78969d2ff 100644 --- a/pom.xml +++ b/pom.xml @@ -58,6 +58,26 @@ <artifactId>java-ipv6</artifactId> <version>0.17</version> </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-annota...
1
1
1
[{"id": "G0", "claim": "The hardcoded `}}`/`{{` literals in getAsPyishStringOrThrow ignore that Jinjava's expression start/end tokens are configurable, so the curly-brace splitting should consult the config values.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
HubSpot__jinjava__916
HubSpot/jinjava
916
defect
dc9593e65f7b877835ce7d7cb1304b76f3d724cc
ed628e46533dc166b1321038974118af43a442d6
Throw warning when intersection Set elements have mismatched types
### Problem While the `type()` function helps give developers visibility of the types of jinjava variables, sometimes developers infer the types of objects by printing them in an expression eg. `{{ some variable }}`. This can cause some confusion when variables are evaluated to Strings. For example, within HubL,...
diff --git a/src/main/java/com/hubspot/jinjava/lib/filter/IntersectFilter.java b/src/main/java/com/hubspot/jinjava/lib/filter/IntersectFilter.java index b7d1b9601..9f9c0fffb 100644 --- a/src/main/java/com/hubspot/jinjava/lib/filter/IntersectFilter.java +++ b/src/main/java/com/hubspot/jinjava/lib/filter/IntersectFilter....
6
6
2
[{"id": "G0", "claim": "The mismatched-types warning should be optional / should not fire when intersecting with an empty set, but the S1 logic adds a warning for the empty-set case.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Add a unit test cov...
null
HubSpot__jinjava__928
HubSpot/jinjava
928
defect
67def9b8bb8848fb59d8315c5433dee7b58ad00b
f32e0a6359298b7a9ed19ca3cf623a970af5dceb
Adding EagerCycleTag to Context when Deferred
This change adds the cycle tag to the context when in deferred execution mode. Before this change, when eager execution is enable the cycle tag would drop off and never get added to the context. During eager execution, cycle tag will reconstruct and able to be rendered on second pass.
diff --git a/src/main/java/com/hubspot/jinjava/lib/tag/eager/EagerCycleTag.java b/src/main/java/com/hubspot/jinjava/lib/tag/eager/EagerCycleTag.java index 1c72d553f..171960329 100644 --- a/src/main/java/com/hubspot/jinjava/lib/tag/eager/EagerCycleTag.java +++ b/src/main/java/com/hubspot/jinjava/lib/tag/eager/EagerCycle...
2
2
1
[{"id": "G0", "claim": "The itHandlesDeferredCycle test passes on the pre-change code too, so it does not actually test the deferred-cycle bug the pull request set out to handle.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The test should use org.ass...
null
HubSpot__jinjava__931
HubSpot/jinjava
931
defect
67def9b8bb8848fb59d8315c5433dee7b58ad00b
6d68301808988575cbd786cfaf7f8cae6d764fb4
Refactor StrftimeFormatter conversion logic
Depends on #930 This PR refactors the logic for converting a `strftime`-compatible pattern into a `DateTimeFormatter`. Previously, this process built a pattern string fit for `DateTimeFormatter.ofPattern`. However, this process isn't flexible enough to implement the format codes for locale-specific date, time, a...
diff --git a/src/main/java/com/hubspot/jinjava/el/JinjavaInterpreterResolver.java b/src/main/java/com/hubspot/jinjava/el/JinjavaInterpreterResolver.java index cfc519f67..285043d28 100644 --- a/src/main/java/com/hubspot/jinjava/el/JinjavaInterpreterResolver.java +++ b/src/main/java/com/hubspot/jinjava/el/JinjavaInterpre...
5
1
0
[{"id": "G0", "claim": "Renaming the new conversion maps to CONVERSION_COMPONENTS and NOMINATIVE_CONVERSION_COMPONENTS would make the code more readable.", "category": "maintainability", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The change makes a format string with an inval...
null
HubSpot__jinjava__997
HubSpot/jinjava
997
defect
ca6a8c234486fa6a6349c71d2d637c6a3b41d8bc
d58e01dc4a1a9edc406a95857400fa6eb964d341
Limit pyish serialization length
Some objects may have exceptionally large serialized representations. If they're larger than the `maxOutputSize` set on the `JinjavaConfig`, then they won't be allowed into the final output and an `OutputTooBigException` will be thrown. However, the process of serializing objects that would do that can be costly in ter...
diff --git a/src/main/java/com/hubspot/jinjava/el/ext/NamedParameter.java b/src/main/java/com/hubspot/jinjava/el/ext/NamedParameter.java index 39170e65e..9cf11269b 100644 --- a/src/main/java/com/hubspot/jinjava/el/ext/NamedParameter.java +++ b/src/main/java/com/hubspot/jinjava/el/ext/NamedParameter.java @@ -1,6 +1,7 @@...
6
2
0
[{"id": "G0", "claim": "The quoteIfNotNull helper in WhitespaceUtils is not used anywhere in this repository, so it appears to be unnecessary dead code.", "category": "maintainability", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The ternary expression in writePyishSelf shou...
null
HubSpot__jinjava__999
HubSpot/jinjava
999
defect
52e83a9bd49fc64f36023d76afbd8f2aad852d8e
40d44c34cf153289cad80a127496b5b0728744d8
Create format_number filter
Since locales render numbers differently, there needs to be a way to format numbers based on the locale. Currently, the only way is to use the `format_currency` filter and get rid of the currency symbol. This PR creates a `format_number` filter that will do this formatting natively. `format_number(locale, decim...
diff --git a/src/main/java/com/hubspot/jinjava/lib/filter/FilterLibrary.java b/src/main/java/com/hubspot/jinjava/lib/filter/FilterLibrary.java index 544230d9c..2bcb27080 100644 --- a/src/main/java/com/hubspot/jinjava/lib/filter/FilterLibrary.java +++ b/src/main/java/com/hubspot/jinjava/lib/filter/FilterLibrary.java @@ ...
6
6
0
[{"id": "G0", "claim": "The \"decimal precision number\" Jinjava parameter is really a maximum, so it should be named something like \"max decimal precision\".", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The variable `noOfDecimalPlacesInInput` should ...
null
HumanCompatibleAI__imitation__135
HumanCompatibleAI/imitation
135
defect
bfe4bdc0313d1ff4d0df9d4dab30536c9a9cc32f
8a32ae989d811873911e9d44149c9240ecdfa100
Accumulating loggers
Add mean-accumulating log context for tracking discrim and generator stats together even though they are trained serially and with different numbers of kv logs. - [x] See how this looks on our Sacred scripts - [x] ~~Probably should forward `_AccumulatingLogger.logkv_mean` as well.~~
diff --git a/docs/imitation.util.rst b/docs/imitation.util.rst index b6fdef441..d2f731050 100644 --- a/docs/imitation.util.rst +++ b/docs/imitation.util.rst @@ -12,6 +12,14 @@ imitation.util.buffer module :undoc-members: :show-inheritance: +imitation.util.logger module +---------------------------- + +.. auto...
16
13
2
[{"id": "G0", "claim": "Remove the `mpi_rank_or_zero` import and usage, since MPI does not appear to be used or installed by default.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Rephrase the configure() docstring, whose \"(not yet implemented...
null
HumanCompatibleAI__imitation__177
HumanCompatibleAI/imitation
177
defect
96d9f8d7e2463a19be495717e5076ea38b33661a
348586ab4c8547d3c8faddb18cead384c888690b
Add mountain car reward heatmap and reward-vs-time plotters
Putting the Heatmap / reward vs time plotting code from my ipynb into a python file. Not sure if `experiments/` is the best place to put this. Maybe `imitation.scripts` is better since the user might want to import these plotting functions into another file. While translating the code from one format to another, ...
diff --git a/experiments/mountain_car_plots.py b/experiments/mountain_car_plots.py new file mode 100644 index 000000000..75f92634c --- /dev/null +++ b/experiments/mountain_car_plots.py @@ -0,0 +1,269 @@ +"""Heatmaps and reward plotting code for debugging MountainCar.""" + +from functools import partial +import os +from...
16
16
0
[{"id": "G0", "claim": "Import statements should bring in packages and modules only, not individual classes or functions (e.g. `from functools import partial`).", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "`make_next_obs` assumes the env is wr...
null
HumanCompatibleAI__imitation__180
HumanCompatibleAI/imitation
180
defect
75068db00a7d675e474d23eba76302e7cbceb45a
3de5bd7ff94b187d080835e70811e2796395c47a
Make Transitions and Trajectory data classes
Convert `Transitions` and `Trajectory` from named tuples to [data classes](https://docs.python.org/3/library/dataclasses.html) and add variants with and without reward. Specifically, I introduce a `TransitionsNoRew` and `TrajectoryNoRew` base class, and add `TransitionsWithRew` and `TrajectoryWithRew` subclasses. We...
diff --git a/experiments/bc_demo.ipynb b/experiments/bc_demo.ipynb index 4d2504523..dee0d10b0 100644 --- a/experiments/bc_demo.ipynb +++ b/experiments/bc_demo.ipynb @@ -27,7 +27,7 @@ "import numpy as np\n", "\n", "from imitation import bc\n", - "from imitation import util" + "from imitation.util im...
1
1
0
[{"id": "G0", "claim": "The comment in unwrap_traj saying 'no need to replace next_obs since that is never changed by VecEnv auto-reset' is confusing because TrajectoryWithRew has no next_obs field, and should be deleted or reworded.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "int...
null
HumanCompatibleAI__imitation__211
HumanCompatibleAI/imitation
211
defect
e1658329a4b38bd86b6dc75cab11577b95b00575
6cb0d9c144ac11d20c3a951f484a8ce6c50c0b2f
Add TransitionsMinimal and use it in BC
* Adds a subclass of `Transitions`, the dataclass `TransitionsMinimal` with field `obs`, `acts`, and `infos` (`infos` is new to Transitions types!). * Note that `infos` has type annotation `np.ndarray` rather than `Optional[Sequence[dict]]` like in `Trajectory`. This is to simplify `Dataset` and `Buffer` class imp...
diff --git a/experiments/convert_traj.py b/experiments/convert_traj.py index eac1d827c..15ba86b02 100644 --- a/experiments/convert_traj.py +++ b/experiments/convert_traj.py @@ -13,7 +13,7 @@ def convert_trajs_to_sb(trajs: Sequence[types.TrajectoryWithRew]) -> dict: """Converts Trajectories into the dict format ...
10
7
2
[{"id": "G0", "claim": "Merging flatten_trajectories_with_rew into flatten_trajectories behind a runtime transitions_cls parameter adds complexity and loses static type guarantees; the reviewer asks to revert to separate functions.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}...
null
HumanCompatibleAI__imitation__228
HumanCompatibleAI/imitation
228
defect
c668cdaafceabac5249d65a7a4b7e516e4a6f220
2b2929b17ee866ddc9813fefe858ca7091f27c95
Script fixes
Change assert statements in Sacred scripts and config files to ValueErrors in Sacred scripts. Fix expert_demos bug where `rollout_path` errored if argument did not contain "/". Addresses part of #215. Resolves #218.
diff --git a/src/imitation/data/types.py b/src/imitation/data/types.py index 5fc7d9747..fc09efd7c 100644 --- a/src/imitation/data/types.py +++ b/src/imitation/data/types.py @@ -3,6 +3,7 @@ import dataclasses import logging import os +import pathlib import pickle from typing import Optional, Sequence @@ -210,7 +2...
3
2
0
[{"id": "G0", "claim": "The new argument validation in parallel() should raise TypeError instead of ValueError when a config argument has the wrong type.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Questions why train() validates its configuratio...
null
HumanCompatibleAI__imitation__290
HumanCompatibleAI/imitation
290
defect
ae8227073479afc1ebcb83b94991006cfe2fc0a2
8edea778b634c248a825a20a5fe562a13e7e65d6
Error if Data Loader Ends Early
A simple fix to give a more clean and comprehensible error in the edge case where your data iterator ends prior to hitting the number of batches you have asked BC to train for. In the current state of the code, this situation results in an infinite loop of `epoch_num` incrementing upwards, with no explicit error
diff --git a/src/imitation/algorithms/bc.py b/src/imitation/algorithms/bc.py index e8cd6b91e..249ae8d2a 100644 --- a/src/imitation/algorithms/bc.py +++ b/src/imitation/algorithms/bc.py @@ -112,6 +112,7 @@ def update_desc(): ) with contextlib.closing(display): + prior_epoch_batches = b...
1
1
0
[{"id": "G0", "claim": "The prior_epoch_batches bookkeeping is more than needed; a per-epoch got_data flag set inside the for-loop and checked after it, raising an AssertionError ('Data loader returned no data -- did it reset correctly?'), would detect an epoch that yields no batches more simply.", "category": "design"...
null
HumanCompatibleAI__imitation__291
HumanCompatibleAI/imitation
291
defect
ae8227073479afc1ebcb83b94991006cfe2fc0a2
fef3935286673c8e92f169889b16dba44cf9c5f8
quickstart.sh: Various cleanup and ease-of-use improvements
Before this PR, a "symlink already exists" error occurred when running `quickstart.sh` a second time, due to `quickstart.sh` writing `train_expert_demos` output to the same directory and `imitation.util.sacred.build_sacred_symlink` unsuccessfully to overwrite the Sacred symlink generated by the first run. This PR modi...
diff --git a/.gitignore b/.gitignore index 9beb09e9b..cd058b36e 100644 --- a/.gitignore +++ b/.gitignore @@ -150,5 +150,10 @@ dmypy.json # yapf (code formatter) .style.yapf -# cruft produced by one of the adversarial tests -tests/data/reward_models + +# Various testing / quickstart artifacts: + +# Produced by trans...
3
2
0
[{"id": "G0", "claim": "There may be a race condition if something else creates the symlink in the background, though the reviewer notes it likely does not matter much and sees no way to avoid it using pathlib.", "category": "correctness", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "...
null
HumanCompatibleAI__imitation__292
HumanCompatibleAI/imitation
292
defect
ae8227073479afc1ebcb83b94991006cfe2fc0a2
77f3e26a3a524889425fce6ae7bcf5730eb43e1e
Move Jax dependencies to setup extra
This PR moves the `jax` and `jaxlib` dependencies (used only by `imitation.algorithms.tabular_irl`) from the main package requirements to a new "jax" extra. It also adds a warning to `tabular_irl.py` that is displayed when the submodule is imported but `jax` cannot be imported, and adds new documentation to the same s...
diff --git a/ci/build_venv.sh b/ci/build_venv.sh index 268ce0898..079a1d546 100755 --- a/ci/build_venv.sh +++ b/ci/build_venv.sh @@ -9,4 +9,4 @@ fi virtualenv -p python3.7 ${venv} source ${venv}/bin/activate -pip install .[cpu,docs,parallel,test] gym[mujoco] +pip install .[cpu,docs,jax,parallel,test] gym[mujoco] di...
1
1
1
[{"id": "G0", "claim": "The module should re-raise ImportError including the informative msg instead of only issuing a warning when the Jax import fails, since there is no use case for importing tabular_irl without using its functions.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduc...
null
HumanCompatibleAI__imitation__316
HumanCompatibleAI/imitation
316
defect
1eb69a41718c85b5697b030eb7536245b98f90fe
8406eba96c34d229cdebbb9ec966c8276fcad06d
analyze: Generate TeX tables for paper
Upgrade analyze script to generate TeX tables for paper of varying verbosity
diff --git a/docs/algorithms/dagger.rst b/docs/algorithms/dagger.rst index 49dedc829..225cb6c68 100644 --- a/docs/algorithms/dagger.rst +++ b/docs/algorithms/dagger.rst @@ -15,3 +15,8 @@ API :members: :inherited-members: :noindex: + +.. autoclass:: imitation.algorithms.dagger.SimpleDAggerTrainer + :me...
8
7
3
[{"id": "G0", "claim": "The filtering code in _gather_sacred_dicts should be split into a helper function along the lines of _filter_dicts(dicts, key, expected_val).", "category": "maintainability", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The stray debug print(sd.config)...
null